We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51347
    • 82 Posts
    Hi community,

    i use pdoCrumbs for google breadcrumb and have a problem with the ongoing position number.

    Snippet in HTML

    [[pdoCrumbs? &tplWrapper=`crumbWrapperTpl` &tplCurrent=`crumbCurrentTpl` &tpl=`crumbTpl`]]
    


    crumbCurrentTpl is empty chunk

    crumbTpl
    {"@type": "ListItem", "position": 1, "item": {"@id": "[[+link]]"}}
    


    crumbWrapperTpl
    <script type="application/ld+json">
    [[+output]]
    </script>
    


    HTML Output
    <script type="application/ld+json">
          {"@type": "ListItem", "position": 1, "item": {"@id": "google-breadcrumbs.html"}}
          {"@type": "ListItem", "position": 1, "item": {"@id": "google-breadcrumbs/test1.html"}}
          {"@type": "ListItem", "position": 1, "item": {"@id": "google-breadcrumbs/test1.html/test2.html"}}
    </script>
    



    The position of the items is everytime "1". What i need is:
    <script type="application/ld+json">
          {"@type": "ListItem", "position": 3, "item": {"@id": "google-breadcrumbs.html"}}
          {"@type": "ListItem", "position": 2, "item": {"@id": "google-breadcrumbs/test1.html"}}
          {"@type": "ListItem", "position": 1, "item": {"@id": "google-breadcrumbs/test1.html/test2.html"}}
    </script>
    


    Any idea?

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

    • discuss.answer
      • 17301
      • 932 Posts
      Shouldn't it be?

      <script type="application/ld+json">
            {"@type": "ListItem", "position": 1, "item": {"@id": "google-breadcrumbs.html"}}
            {"@type": "ListItem", "position": 2, "item": {"@id": "google-breadcrumbs/test1.html"}}
            {"@type": "ListItem", "position": 3, "item": {"@id": "google-breadcrumbs/test1.html/test2.html"}}
      </script>


      You might be able to try this:

      {"@type": "ListItem", "position": [[+idx]], "item": {"@id": "[[+link]]"}}
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 51347
        • 82 Posts
        You're right! That's it! I had a wrong logic...

        Thank you! [ed. note: joe-petts last edited this post 6 years, 1 month ago.]