Forums / General / SiteMap exclude classes

SiteMap exclude classes

Author Message

Sylvain Gogel

Monday 29 December 2008 8:50:19 am

Hi there, i'm customining ezWebIn sitemap to exclude some classes

here is my template

{def $page_limit=10
     $col_count=2
     $sub_children=0
     $exclude_classes=ezini( 'SitemapClassesToExclude', 'ExcludeClass', 'sitemap.ini' )
	 $children=fetch('content','list', hash(
										   'parent_node_id', $node.node_id,
                                           'limit', $page_limit,
                                           'offset', $view_parameters.offset,
                                           'sort_by', $node.sort_array,
                                           'class_filter_type', 'exclude',
                                           'class_filter_array', $exclude_classes)
                                           )
}
{*$exclude_classes|attribute(show,1)*}
<div class="border-box">
<div class="border-tl"><div class="border-tr"><div class="border-tc"></div></div></div>
<div class="border-ml"><div class="border-mr"><div class="border-mc float-break">

<div class="content-view-sitemap">

<div class="attribute-header">
    <h1 class="long">{"Site map"|i18n("design/ezwebin/view/sitemap")} {$node.name|wash}</h1>
</div>

<table width="100%" cellspacing="0" cellpadding="4">
<tr>
{foreach $children as $key => $child}
    <td>
    <h2><a href={$child.url_alias|ezurl}>{$child.name}</a></h2>
    {if $child.class_identifier|eq( 'event_calendar' )}
        {set $sub_children=fetch('content','list',hash( 'parent_node_id', $child.node_id, 
                                                        'limit', $page_limit,
                                                        'sort_by', array( 'attribute', false(), 'event/from_time' ) ) )}
    {else}
        {set $sub_children=fetch('content','list',hash( 'parent_node_id', $child.node_id,
                                                        'limit', $page_limit,
                                                        'sort_by', $child.sort_array))}
    {/if}
    <ul>
    {foreach $sub_children as $sub_child}
    <li><a href={$sub_child.url_alias|ezurl}>{$sub_child.name}</a></li>
    {/foreach}
    </ul>
    </td>
    {if ne( $key|mod($col_count), 0 )}
</tr>
<tr>
    {/if}
{/foreach}
</tr>
</table>

</div>

</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>

here is my sitemap.ini file

# Settings related to the sitemap

[SitemapClassesToExclude]
ExcludeClass[]
ExcludeClass[]=faq_entry

The exclude_classes array looks good in the template
this:

{$exclude_classes|attribute(show,1)}

output that:

 0 	string 	'faq_entry'

but in the display i still have those faq_entry in the sitemap.

any ideas?

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

André R.

Monday 29 December 2008 9:09:49 am

Your missing class exclude filter on the $sub_children fetch.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Sylvain Gogel

Tuesday 30 December 2008 12:29:36 am

Thanks andré, it works like a charm now ^_^

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony