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.

    &itemTpl=`@INLINE <p class="capitalizeFirstLetter"><a href="[[+url]]">[[+pagetitle]]</a></p>`
    &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>`

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

SitemapFriend works out of the box with


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.


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”.