New Community Forums are coming. Watch this space for news.
Subscribe: RSS
  • Hi there!

    I'm trying to add the rich-snippet breadcrumb via the wayfinder call, because the project/site itself doesn't use "real" breadcrumbs.

    So far I edited the outerTpl and the rowTpl, but now I have to add an id for the meta-property-part:

    <ol vocab="http://schema.org/" typeof="BreadcrumbList">
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage"
            href="https://example.com/arts">
          <span property="name">Arts</span></a>
        <meta property="position" content="1">
      </li>
      
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage"
            href="https://example.com/arts/books">
          <span property="name">Books</span></a>
        <meta property="position" content="2">
      </li>
      
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage"
            href="https://example.com/arts/books/poetry">
          <span property="name">Poetry</span></a>
        <meta property="position" content="3">
      </li>
    </ol>


    I tried using this:

    <meta property="position" content="[[+idx]]">


    but this seems not to work, the [[+idx]] part is empty.

    Isn't idx is implemented/usable this way?

    This question has been answered by donquicky. See the first response.

    • discuss.answer
      As far as I know, Wayfinder does not support
      [[+idx]]
      . The +idx placeholder does exist in extra getResources which you also can use to build any menu.

      When still using Wayfinder maybe the placeholder
      [[+menuindex]]
      can be an option to you?
        Codeplaza Webdesign: for professional websites at low cost
      • Hi DonQuickie!

        Thank you for your reply...

        My researches resulted in the same, idx is not available by using wayfinder. I thought about creating a template-variable, but your suggestion to use the menuindex looks even better to me! Thanks for pointing me to that.

        Btw....I tried the Google-structured-data-testing-tool even without using the meta-property-position-line, and the test has been successful. So I think it's not necessary to add this line to each li-element.

        I also didn't think about using getResources to create the menu, but yeah, this would be an option as well.

        Thanks again.
        • Or you can use pdoTools. It provides an idx placeholder for all of its snippets.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
          • Hi Susan!

            Thanks for your reply as well.

            And yeah, I found this during my researches too, but somehow I wanted to stick to wayfinder instead of using pdoTools for the first time. But this surely works too!
            • Сниппет: Idx

              <?php
              global $_idx;
              if (!isset($_idx)) $_idx = 0;
              echo ++$_idx;