Forums / Setup & design / Site map in alphabetical order
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
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.-
Friday 16 April 2010 4:23:57 am
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.
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={"/Exponential-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,
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
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 :)