How to get pdoSitemap output pagetitles in the links

Modx 3.0.1 - pdoTools 3.0.1
This is not about an XML sitemap but trying to build a page containing a sitemap I can’t get the pagetitles to display in the links.
I tried different @inline templates but the [[+url]] is only output once per item, either in the href attribute or in the link as text. Never both.
Also tried &toPlaceholder = myUrl and then use that twice to build the link, but to no avail.
Trying to output [[+pagetitle]] as link text would suit best but that doesn’t work either.

[[!pdoSitemap?
    &resources=`-29`
    &parents=`0,24,168,169,-187,-264,-272`
    &sortby=`alias`
    &context=`nl`
    &useWeblinkUrl=`0`
    &itemTpl=`@INLINE <p class="capitalizeFirstLetter"><a href="[[+url]]">[[+pagetitle]]</a></p>`
    &XitemTpl=`sitemap_item`
    &XitemTpl=`@INLINE <p class="capitalizeFirstLetter"><a [[+link]]>[[+url]]</a></p>`
    &XitemTpl=`@INLINE <p class="capitalizeFirstLetter">[[!+link]]</p>`
    &XitemTpl=`@INLINE <p class="capitalizeFirstLetter"><a href="[[+url]]">[[+url]]</a></p>`
    &showLog=`1`
    &forceXML=`0`
]]

How can I achieve this? Or should I just use another Extra like SitemapFriend?

SitemapFriend works out of the box with

[[!sitemapFriend? 
    &type=`html`
]]

But it has another problem though: as soon as I use &onlyTemplates or &excludeTemplates, the rendered sitemap doesn’t go deeper than the top level.

[[!sitemapFriend? 
    &type=`html`
    &onlyTemplates=`3`
    &XskipTemplates=`4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20`
    &XincludeResources=`0,24,168,169`
]]

pdoSitemap is probably just the wrong tool for what you are trying to do. Maybe you could use pdoMenu instead.

I can’t reproduce this.

pagetitle is not selected in the query and is therefore not available as a placeholder.

1 Like

I don’t know why I didn’t think of it as a menu :face_with_raised_eyebrow: but I think you’re absolutely right pdoMenu is the right tool.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.