Site map in alphabetical order

Author Message

Juan Asencio

Friday 16 April 2010 1:05:55 am

Hi,

I would like to show the content of my sitemap in alphabetical order. Right now I can see all the content of the website, but I don't know how to order it by name.

I don't have any idea where to start, any suggestions?

Regards

Nicolas Pastorino

Friday 16 April 2010 2:00:54 am

Hi Juan,

You can override the sitemap view mode of the '/content/view/' view. If using ezwebin or ezflow, here is the template you can override and modify : extension/ezwebin/design/ezwebin/templates/node/view/sitemap.tpl.

You will see various call to the following template fetch function :

{def $children = fetch('content', 'list', [...])}

the sort method of which you can override as explained there : http://ez.no/doc/ez_publish/technical_manual/4_x/reference/modules/content/fetch_functions/list ( 'sort_by' parameter ).

Let us know how it goes,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Juan Asencio

Friday 16 April 2010 2:11:25 am

Nicolas,

Thank you for your reply, I will have a look at it and let you know how did it go.

Cheers,

Juan.-

Juan Asencio

Friday 16 April 2010 4:23:57 am

Nicolas,

Now is almost working, I can control which content I want to show.

But how can I show only the content of the site access where the user is?

I can't figure it out where to edit the address where the sitemap link is directed to, always keep been node 2.

Cheers,

Juan.-

Juan Asencio

Friday 16 April 2010 5:51:26 am

Ok, now I have hardcoded the link on the design/my_design/templates/page_header_links.tpl as:

<li id="sitemap"><a href={"/ezpublish-4.3b/index.php/.../content/view/sitemap/63"}...

instead of:

<li id="sitemap"><a href={$pagedesign.data_map.site_map_url.content|ezurl}...

But is a way to direct the site_map_url to a specific node?

Because this solution will not work for my other siteaccess, unless I make my_design directory for each siteaccess.

Any suggestions are welcome, I'm sure must be a better way to do this.

Regards,

Juan.-

Peter Keung

Friday 16 April 2010 7:41:41 am

This is where INI files + ezurl() operator are a good solution. For example, if you want to link to different root nodes per siteaccess, you use something like:

<a href={concat( 'content/view/sitemap/', ezini( 'NodeSettings', 
'RootNode', 'content.ini' ) )|ezurl()}>

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

Juan Asencio

Wednesday 21 April 2010 12:10:57 am

Hi everybody,

Thank you for your replies.

Peter, your comment show me the right way to do it. Now I understand what the ezini it is for :)

Cheers,

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 02:15:25
Script start
Timing: Jan 18 2025 02:15:25
Module start 'layout'
Timing: Jan 18 2025 02:15:25
Module start 'content'
Timing: Jan 18 2025 02:15:27
Module end 'content'
Timing: Jan 18 2025 02:15:27
Script end

Main resources:

Total runtime1.4066 sec
Peak memory usage4,096.0000 KB
Database Queries72

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.0313152.6250
Module start 'layout' 0.00530.0021 741.656339.4609
Module start 'content' 0.00751.3977 781.1172628.2578
Module end 'content' 1.40520.0014 1,409.375016.1641
Script end 1.4066  1,425.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2221160.0002
Check MTime0.00130.0938160.0001
Mysql Total
Database connection0.00070.047710.0007
Mysqli_queries1.341195.3412720.0186
Looping result0.00070.0531700.0000
Template Total1.380098.120.6900
Template load0.00210.149420.0011
Template processing1.377997.960120.6890
Template load and register function0.00010.007410.0001
states
state_id_array0.00080.055610.0008
state_identifier_array0.00090.064420.0005
Override
Cache load0.00180.1292480.0000
Sytem overhead
Fetch class attribute can translate value0.00070.047230.0002
Fetch class attribute name0.00100.070390.0001
XML
Image XML parsing0.00100.069230.0003
class_abstraction
Instantiating content class attribute0.00000.001290.0000
General
dbfile0.00080.0593230.0000
String conversion0.00000.000540.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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs