Using atributes of users class

Author Message

Pavel Konovalov

Friday 03 November 2006 4:24:27 am

HI 2 all!
I have some trouble when I use users class.

I create a class.
This class consist of 10 attributes.
One of them has type "Selection".
This attribute have 10 "Options".

Condition: When I select one from 10 options (for example 5th) and reload page, I need to disable some other ones (for example 1st and 2nd). How can I do this?

Maybe I should use JavaScript, or maybe there is another way to solve this problem?

Are you gangsters?!
No, we are Russians.

Claudia Kosny

Tuesday 07 November 2006 11:17:04 am

Hi Pavel

Javascript would certainly be an option although it is inherently unsafe. The nice thing about javascript is that your user does not need to reload the page.
If you want to do it in the template you can create an override for the \design\standard\templates\content\datatype\edit\ezselection.tpl template. Just get the selected option from the attribute content and disable the other options as required.

Claudia

Pavel Konovalov

Tuesday 07 November 2006 11:33:51 am

Hi Claudia
>Just get the selected option from the attribute content and disable the
other options as required.

But how I can do that?

Are you gangsters?!
No, we are Russians.

Claudia Kosny

Tuesday 07 November 2006 11:46:11 am

Hi

Have a look at the template I mentioned before. There you have

...
{let selected_id_array=$attribute.content}
...
<option value="{$Options.item.id}" {section show=$selected_id_array|contains( $Options.item.id )}selected="selected"{/section}>{$Options.item.name|wash( xhtml )}</option>
...

This shows that $selected_id_array is an array that contains the selected option(s).

Claudia

Pavel Konovalov

Tuesday 07 November 2006 11:58:43 am

Tthank you, Claduia!
Maybe, I solve my trouble.

Are you gangsters?!
No, we are Russians.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 04:15:18
Script start
Timing: Jan 31 2025 04:15:18
Module start 'layout'
Timing: Jan 31 2025 04:15:18
Module start 'content'
Timing: Jan 31 2025 04:15:18
Module end 'content'
Timing: Jan 31 2025 04:15:18
Script end

Main resources:

Total runtime0.0154 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.1328151.2109
Module start 'layout' 0.00510.0023 739.343836.6484
Module start 'content' 0.00750.0064 775.992294.2656
Module end 'content' 0.01390.0014 870.257833.9922
Script end 0.0153  904.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002315.1414140.0002
Check MTime0.00106.5760140.0001
Mysql Total
Database connection0.00063.719810.0006
Mysqli_queries0.002616.974230.0009
Looping result0.00000.071310.0000
Template Total0.00116.910.0011
Template load0.00085.234810.0008
Template processing0.00031.677710.0003
Override
Cache load0.00063.699710.0006
General
dbfile0.002314.710480.0003
String conversion0.00000.045040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs