specific number of fields

Author Message

Mazen Alsibai

Sunday 21 August 2005 12:49:29 am

Hi :
i want to show a few number of hte fields of an object when i want to edit it,how can i do that?
can anyone help me please?

Paul Borgermans

Sunday 21 August 2005 5:05:48 am

Hi

You need to create an override for the edit template. I suggest, you copy the default edit.tpl ans start from there:

Look for the loop which iterates over the attributes:

 {section name=ContentObjectAttribute loop=$content_attributes sequence=array(bglight,bgdark)}

Inside this loop, you can filter out one or more attributes like below

 {section show=array('attribute_identifier1','other_attribute_identifier')|contains($ContentObjectAttribute:item.contentclass_attribute_identifier) }
     
<label>{$ContentObjectAttribute:item.contentclass_attribute.name|wash}</label><div class="labelbreak"></div>
        <input type="hidden" name="ContentObjectAttribute_id[]" value="{$ContentObjectAttribute:item.id}" />
        {attribute_view_gui attribute_base=$attribute_base attribute=$ContentObjectAttribute:item}
        </div>
    {section-else}
        <label>{$ContentObjectAttribute:item.contentclass_attribute.name|wash}</label><div class="labelbreak"></div>
        <input type="hidden" name="ContentObjectAttribute_id[]" value="{$ContentObjectAttribute:item.id}" />
        {attribute_edit_gui attribute_base=$attribute_base attribute=$ContentObjectAttribute:item}
        </div>

    {/section}

In the example above, 2 attributes will be non-editable, just their value is shown. You may want to suppress the values output too visually, by eliminating <i>attribute_view_gui</i>, but it will be in the xhtml source code.

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Mazen Alsibai

Sunday 21 August 2005 10:30:43 am

Hi:
first thanks for care,
can i create 2 override for the template edit for one class, and how?

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 19 2025 08:25:11
Script start
Timing: Jan 19 2025 08:25:11
Module start 'layout'
Timing: Jan 19 2025 08:25:11
Module start 'content'
Timing: Jan 19 2025 08:25:13
Module end 'content'
Timing: Jan 19 2025 08:25:13
Script end

Main resources:

Total runtime1.3452 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.1563152.6250
Module start 'layout' 0.00660.0034 741.781339.4453
Module start 'content' 0.00991.3337 781.2266536.6172
Module end 'content' 1.34360.0016 1,317.843812.1641
Script end 1.3452  1,330.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2609160.0002
Check MTime0.00150.1091160.0001
Mysql Total
Database connection0.00120.089710.0012
Mysqli_queries1.293096.1206570.0227
Looping result0.00060.0481550.0000
Template Total1.306897.120.6534
Template load0.00220.162720.0011
Template processing1.304696.981720.6523
Template load and register function0.00020.014710.0002
states
state_id_array0.00190.140710.0019
state_identifier_array0.00230.168120.0011
Override
Cache load0.00180.1346210.0001
Sytem overhead
Fetch class attribute can translate value0.00090.066720.0004
Fetch class attribute name0.00200.150040.0005
XML
Image XML parsing0.00070.051820.0003
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00070.0554170.0000
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs