pdoPage avoid jumping to top when switching pages

I’m using pdoPage within a section further down within my site. Is there a way to define like a target section id or similar to make pdoPage jump to after switching pages? Similar to a link with a #target reference?

Example:

<body>
  <section>
    // some content here
  </section>

  <section id="pdoPageGoHere">
    [[!pdoPage? 
      ...]]

    [[!+page.nav]]
  </section>

I believe it’s possible to use the javascript callback pdoPage.callbacks['after'] and then execute some custom JS code that jumps/scrolls to a specific element.

See the documentation:

https://docs.modx.com/3.x/en/extras/pdoTools/Snippets/pdoPage#javascript-callbacks

1 Like

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