Developer forum

Forum » Templates » Showing Child Pages in the Sitemap when Parent is hidden

Showing Child Pages in the Sitemap when Parent is hidden


Reply
Hi there,

I am trying to show two sub pages in the sitemap.xml file, while hiding the parent. Consider these three pages:

- Services
  - Service 1
  - Service 2

In sitemap.xml, I only want to show Service 1 and Service 2. However, as soon as I uncheck "Show in Sitemap" for the Services parent item, Service 1 and Service 2 don't show up in the sitemap anymore.

Is this a bug or a feature?

Imar

Replies

 
Nicolai Høeg Pedersen
Reply
I'm affraid it is a feature - can't show anything further down in the tree if a node is missing - that is how it is thought...

BUT - the sitemap is 'just' a navigation - so you can make a sitemap using a navigation tag and test on ShowInSitemap attribute of the page node...
 
Reply
Hi Nicolai,

Thanks for the answer.

I am not 100% sure what you mean or how to implement this. I was talking about the Google sitemap.xml file. When I uncheck the parent item, the node and underlying items are not available so I don't know what to test where.

When processing the tree in a NavigationProvider, the item doesn't show up there either.

Imar
 
Nicolai Høeg Pedersen
Reply
Oh - thought you meant sitemap module...

Then there is no workaround.

Just changed the behaviour so it is handled by the XSLT and not the navigation object to handle wether show in sitemap is having an effect on the sitemap output.

That means, that you can handle this from SEOSitemap.xslt:

<xsl:if test="@ShowInSitemap='True'">
      <loc>
        <xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/>
      </loc>
   </xsl:if>

 
Reply
Makes perfect sense. Thanks!

Imar

 

You must be logged in to post in the forum