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

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 22:10:36
Script start
Timing: Jan 18 2025 22:10:37
Module start 'layout'
Timing: Jan 18 2025 22:10:37
Module start 'content'
Timing: Jan 18 2025 22:10:37
Module end 'content'
Timing: Jan 18 2025 22:10:37
Script end

Main resources:

Total runtime0.6324 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.8828152.6094
Module start 'layout' 0.00560.0034 740.492239.4141
Module start 'content' 0.00900.6220 779.9063558.1875
Module end 'content' 0.63100.0014 1,338.093812.1875
Script end 0.6324  1,350.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.5071160.0002
Check MTime0.00130.1996160.0001
Mysql Total
Database connection0.00080.133910.0008
Mysqli_queries0.578891.5199570.0102
Looping result0.00050.0843550.0000
Template Total0.597194.420.2986
Template load0.00190.303120.0010
Template processing0.595294.107120.2976
Template load and register function0.00010.022310.0001
states
state_id_array0.00110.177410.0011
state_identifier_array0.00070.108520.0003
Override
Cache load0.00160.2493220.0001
Sytem overhead
Fetch class attribute can translate value0.00050.073720.0002
Fetch class attribute name0.00080.127650.0002
XML
Image XML parsing0.00400.633920.0020
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00440.6906230.0002
String conversion0.00000.001340.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/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/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs