Exclude nodes from sitemap

Author Message

Softriva .com

Monday 19 March 2007 7:23:43 am

How to prevent nodes from appearing in the sitemap?

Monday 19 March 2007 7:55:47 am

Survey says ... 'Template Modification' or what is 'Template and or Class Modification'?

This is not a new subject, check through the history,
<i>http://www.google.com/custom?cx=016925729212334848828:gr8yusdgz9g&cof=LH%3A34%3BCX%3AGooZee%3BFORID%3A0%3BS%3Ahttp%3A%2F%2Fgoozee%2Ebenn%2Eorg%2F%3BL%3Ahttp%3A%2F%2Fgoozee%2Ebenn%2Eorg%2Fimages%2Fgoozee%2Epng%3BLP%3A1&q=Sitemap&sa=GooZee+Search&hl=en&client=google-coop-np</i>
<i>http://ez.no/content/advancedsearch?&SearchText=sitemap&SubTreeArray%5B%5D=308&SearchDate=-1&SearchPageLimit=5</i>

Softriva .com

Monday 19 March 2007 8:20:01 am

Dear Mr. ???????

Did you actually find the answer in the history or you just made a search for "Sitemap" and saw so many results then you assumed that answer is there?

OOzy

kracker (the)

Monday 19 March 2007 8:31:51 am

It did mention, template modification ... what's more to say?

Take a look at how the ezwebin site design extension does it,
<i>extension/ezwebin/design/ezwebin/templates/node/view/sitemap.tpl
From: http://ez.no/community/forum/general/site_map_template/re_site_map_template__7</i>

<i>//kracker

KMK - Zen State</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Softriva .com

Monday 19 March 2007 9:50:16 am

I think there a misunderstanding here. The whole thread is about template overriding.

My question is that in the whole content structure there is a node that I don't want it to appear in the sitemap.

I am using sitemap.tpl and I don't need to override pagelayout.tpl.

Am I missing something?

kracker (the)

Monday 19 March 2007 10:31:39 am

>> I think there a misunderstanding here. The whole thread is about template overriding.

I disagree. I hypervisor all your thinking and then some ;)

>> My question is that in the whole content structure there is a node that I don't want it to appear in the sitemap.

Then you need to edit sittemap.tpl and either add a content object attribute check for a specific attribute includes an 'exclude from menu'. Add this attribute to all your classes, recreate all your content to include this new class attribute set or not set as needed, and clear cache.

Or just write a static exclusion in your template code (lazy thoughts get work done)
{if $node.node_id|ne(42)}
your site menu logic and content ... are you trying yet?
{/if}

>> I am using sitemap.tpl and I don't need to override pagelayout.tpl.

Naturally :) I include my references when possible, that doesn't mean that they always are relevant 100% on your query.

>> Am I missing something?

Only the adversity to take action on your own ...

<i>//kracker

KMK - Hustle</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Softriva .com

Monday 19 March 2007 12:03:28 pm

Kracker,

>>I disagree. I hypervisor all your thinking and then some ;)

Yes there is a misunderstanding. This is noticeable from your answer below

>><b>Then</b> you need to edit sittemap.tpl and either add a content object attribute check for a specific attribute includes an 'exclude from men..............

>>Naturally :) I include my references when possible, that doesn't mean that they always are relevant 100% on your query

Sorry but you threw me off. You referred me to irrelevant post.

>>Only the adversity to take action on your own ...
You really don't know.

Any how thanks for your answer and please next time if you don't have the relevant answer please don't post it.

Tuesday 20 March 2007 1:31:03 am

<i>Original: http://svn.ez.no/svn/extensions/ezwebin/trunk/extension/ezwebin/design/ezwebin/templates/node/view/sitemap.tpl</i>
Modification:

{def $page_limit=10
     $col_count=2
     $sub_children=0
     $children=fetch('content','list',hash('parent_node_id', $node.node_id,
                                           'limit', $page_limit,
                                           'offset', $view_parameters.offset,
                                           'sort_by', $node.sort_array))}
{*
   Exclude Item From Menu (Exclude ID/Array)
*}
{def $exclude=42}
<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}

{*
   Exclude Item From Menu (Addition)
*}

  {if $child.node_id|ne($exclude)}

    <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}
{*
   Exclude Item From Menu (Addition)
*}
  {if $sub_child.node_id|ne($exclude)}
    <li><a href={$sub_child.url_alias|ezurl}>{$sub_child.name}</a></li>
  {/if}

    {/foreach}
    </ul>
    </td>
    {if ne( $key|mod($col_count), 0 )}
</tr>
<tr>
    {/if}
  {/if}
{/foreach}
</tr>
</table>

</div>

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

Andy Boston

Friday 29 October 2010 4:25:20 am

Hi,

We need to stop specific classes from appearing in the site map but the code above doesn't work in 4.3 ezflow

Please can someone give us some code that will work?

Thanks in advance :)

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 10:41:11
Script start
Timing: Jan 18 2025 10:41:11
Module start 'layout'
Timing: Jan 18 2025 10:41:11
Module start 'content'
Timing: Jan 18 2025 10:41:13
Module end 'content'
Timing: Jan 18 2025 10:41:13
Script end

Main resources:

Total runtime1.2132 sec
Peak memory usage4,096.0000 KB
Database Queries79

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.9141152.6250
Module start 'layout' 0.00620.0029 740.539139.4453
Module start 'content' 0.00901.2029 779.9844700.1797
Module end 'content' 1.21190.0013 1,480.164124.1641
Script end 1.2132  1,504.3281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2631160.0002
Check MTime0.00130.1057160.0001
Mysql Total
Database connection0.00110.088110.0011
Mysqli_queries1.129793.1196790.0143
Looping result0.00090.0713770.0000
Template Total1.181097.320.5905
Template load0.00210.176020.0011
Template processing1.178997.169220.5894
Template load and register function0.00020.018710.0002
states
state_id_array0.00140.119010.0014
state_identifier_array0.00220.177420.0011
Override
Cache load0.00200.1657640.0000
Sytem overhead
Fetch class attribute can translate value0.00080.067640.0002
Fetch class attribute name0.00210.1762120.0002
XML
Image XML parsing0.00210.174540.0005
class_abstraction
Instantiating content class attribute0.00000.0025140.0000
General
dbfile0.00140.1118290.0000
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
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 35
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs