Just one list for parent and child

Author Message

Leandro Alves

Thursday 29 September 2005 7:59:50 am

Hi!

<b>I have this structure:</b>

-forum (node 63)
--|
--|forum_topic1
-----|
-----|forum_reply1
-----|forum_reply2
--|
--|forum_topic2
-----|forum_reply1

I would like to make just a list with all forum_topic and forum_reply by the last published order.

<b>I have tried this:</b>

   
{let folder_list=fetch(content,list,hash(parent_node_id,63,
                      class_filter_type,include,
                      class_filter_array,array('folder')))}

{section var=folder loop=$folder_list}

{let last=fetch('content','tree',hash(parent_node_id,               
                                     $folder.node_id,
             sort_by, array(array('published', false() ) ),
             limit, 5 ) )}

{section var=reply loop=$last show=$last}
    <a href={concat( $reply.parent.url_alias, '#msg', 
     $reply.node_id )|ezurl}>{$reply.name|wash}</a>
{/section}
{/let}

{/section}
{/let}

This works fine and show me the last five itens published.

But I have a wrong link for all forum_topic nodes.

for example:

<b>If the item is a forum_reply I have this link:</b>
http://.../folder/forum_topic#msg99 <b>(its ok)</b>

<b>If the item is a forum_topic I have this link:</b>
http://.../folder#msg99 <b>(its wrong)</b>

This link <b>http://.../folder#msg99</b> should be like this <b>http://.../folder/forum_topic</b>

I suppose I have to change something in my code, but I don't know what and I need help.

Thanks in advance!

Leandro

Kristof Coomans

Thursday 29 September 2005 9:33:04 am

{section var=reply loop=$last show=$last}
    {section show=$reply.class_identifier|eq('forum_reply')}
    <a href={concat( $reply.parent.url_alias, '#msg', 
     $reply.node_id )|ezurl}>{$reply.name|wash}</a>
    {section-else}
    <a href={$reply.url_alias|ezurl}>{$reply.name|wash}</a>
    {/section}
{/section}

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Eder Trevisoli

Thursday 29 September 2005 11:37:15 am

Hey Leandro,
I don&acute;t understand, hehehe ;-(

______________
Eder Trevisoli
BRASIL

Leandro Alves

Thursday 29 September 2005 12:26:35 pm

Hello Kristof!!!!

Thanks a lot for your reply... It works like a charm!!!! :)

Cheers!

Leandro

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 18 2025 11:12:14
Script start
Timing: Jan 18 2025 11:12:14
Module start 'layout'
Timing: Jan 18 2025 11:12:14
Module start 'content'
Timing: Jan 18 2025 11:12:15
Module end 'content'
Timing: Jan 18 2025 11:12:15
Script end

Main resources:

Total runtime1.0181 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.0156152.6250
Module start 'layout' 0.00650.0042 740.640639.4453
Module start 'content' 0.01071.0058 780.0859593.3047
Module end 'content' 1.01660.0015 1,373.390612.1563
Script end 1.0180  1,385.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3924160.0002
Check MTime0.00170.1673160.0001
Mysql Total
Database connection0.00080.083110.0008
Mysqli_queries0.958094.0999620.0155
Looping result0.00060.0620600.0000
Template Total0.980896.320.4904
Template load0.00290.284220.0014
Template processing0.977996.056920.4890
Template load and register function0.00020.020610.0002
states
state_id_array0.00100.100210.0010
state_identifier_array0.00260.252420.0013
Override
Cache load0.00250.2454410.0001
Sytem overhead
Fetch class attribute can translate value0.00090.084230.0003
Fetch class attribute name0.00130.122860.0002
XML
Image XML parsing0.00120.120330.0004
class_abstraction
Instantiating content class attribute0.00000.000960.0000
General
dbfile0.00100.0987220.0000
String conversion0.00000.001240.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/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: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs