override doesn't work in this code...

Author Message

Torbjørn Laukvik

Monday 02 May 2005 6:11:07 am

Using this code from http://www.ez.no/ez_publish/documentation/customization/tips_tricks/one_article_folder

{* Get the articles (ClassID: "2"! Might be different for you!) *}
{let articles=fetch('content','list',hash(parent_node_id,$node.node_id,class_filter_type,"include",class_filter_array,array(2)))}

{* Get a count of the articles (ClassID: "2"! Might be different for you!) in this folder. *}
{let articles_count=fetch('content','list_count',hash(parent_node_id,$node.node_id,class_filter_type,"include",class_filter_array,array(2)))}

{* Now decide what to do *}
{switch name=decision match=$articles_count}
{case match=1}
        {* Show this if there is only one article! E.g. include the "full article view" page. *}
        {section name=Article loop=$articles}
                {node_view_gui view=full content_node=$decision:Article:item}
        {/section}
{/case}
{case}
        {* Show this for more than one article. *}
        {section name=Article loop=$articles}
                <h3>{$decision:Article:item.name}</h3>
                {$decision:Article:item.data_map.intro.data_text}<br /><br />
                {section name=read_link show=$decision:Article:item.contentobject_version_object.data_map.body}
                        <a href={concat("/content/view/full/",$decision:Article:item.node_id)|ezurl}>Read more...</a>
                {/section}
                <hr />
        {/section}
{/case}
{/switch}

The problem is that if its just one article in the folder, it's not using my template overides. If there is two or more, this code list's it up and then uses my full_view template overide when you click one.

<a href={concat("/content/view/full/",$decision:Article:item.node_id)|ezurl}>Read more...</a>


This code is the one that uses my template overides, prob. since it's calling content/view/full, and I've modified that.

then why doesn't this do the same???:

{section name=Article loop=$articles}
                {node_view_gui view=full content_node=$decision:Article:item}
{/section}

please help........

Łukasz Serwatka

Thursday 05 May 2005 11:22:02 pm

Hi Torbjørn,

You need tpl for full view and for line view. You can also improve speed of your code without additional fetching.

You will have to create node override if you want use it for one folder.

{section show=eq( $node.children_count, 1 )}
    {node_view_gui view=full content_node=$node.children.0}
{section-else}
    {section loop=$node.children}
            {node_view_gui view=line content_node=$item}
    {/section}
{/section}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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 01:18:09
Script start
Timing: Jan 19 2025 01:18:09
Module start 'layout'
Timing: Jan 19 2025 01:18:09
Module start 'content'
Timing: Jan 19 2025 01:18:09
Module end 'content'
Timing: Jan 19 2025 01:18:09
Script end

Main resources:

Total runtime0.7777 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.2578152.6250
Module start 'layout' 0.00580.0048 741.882839.4453
Module start 'content' 0.01060.7658 781.3281532.7188
Module end 'content' 0.77640.0013 1,314.046912.1563
Script end 0.7777  1,326.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4778160.0002
Check MTime0.00140.1759160.0001
Mysql Total
Database connection0.00090.116510.0009
Mysqli_queries0.732894.2147540.0136
Looping result0.00050.0693520.0000
Template Total0.745195.820.3726
Template load0.00210.266820.0010
Template processing0.743095.537320.3715
Template load and register function0.00020.022510.0002
states
state_id_array0.00080.104410.0008
state_identifier_array0.00080.101620.0004
Override
Cache load0.00170.2131180.0001
Sytem overhead
Fetch class attribute can translate value0.00110.142120.0006
Fetch class attribute name0.00090.117530.0003
XML
Image XML parsing0.00090.120120.0005
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00090.1195180.0001
String conversion0.00000.001740.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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