eZ Community » Forums » Setup & design » Exclude nodes from sitemap
expandshrink

Exclude nodes from sitemap

Exclude nodes from sitemap

Monday 19 March 2007 3:23:43 pm - 8 replies

How to prevent nodes from appearing in the sitemap?

Monday 19 March 2007 3:55:47 pm

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=0...&client=google-coop-np</i>
<i>http://ez.no/content/advancedsear...e=-1&SearchPageLimit=5</i>

Monday 19 March 2007 4:20:01 pm

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

Monday 19 March 2007 4:31:51 pm

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/gene...te/re_site_map_template__7</i>

<i>//kracker

KMK - Zen State</i>

Modified on Monday 19 March 2007 4:35:23 pm by // kracker

Monday 19 March 2007 5:50:16 pm

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?

Monday 19 March 2007 6:31:39 pm

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

I disagree. I hypervisor all your thinking and then some blunk.gif Emoticon

>> 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 happy.gif Emoticon 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>

Modified on Monday 19 March 2007 6:32:23 pm by // kracker

Monday 19 March 2007 8:03:28 pm

Kracker,

>>I disagree. I hypervisor all your thinking and then some blunk.gif Emoticon

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 happy.gif Emoticon 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 9:31:03 am

<i>Original: http://svn.ez.no/svn/extensions/e...ates/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>

Friday 29 October 2010 1:25:20 pm

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 happy.gif Emoticon

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from