1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Adding Page Anchors to Pagination Links

Discussion in 'Styling and Customization Questions' started by SurferJon, Feb 18, 2015.

  1. SurferJon

    SurferJon Member

    Hi, I'm trying to add #page-anchors to the end of the pagination links on thread pages. As in, when you click the numbers, they'll have the #page-anchor I specify at the end of each link. Does anyone know how I can do this with the pagination bit:

    Code:
                <xen:pagenav link="threads" linkdata="{$thread}"
                    page="{$page}" perpage="{$postsPerPage}" total="{$replycountxfwp}"
                    unreadlink="{$unreadLink}"
                />
    Thank you!
     
  2. SurferJon

    SurferJon Member

    Can anyone help? :p
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    It's not clear what you're trying to do.
    Why do you need anchors on those links?
     
  4. SurferJon

    SurferJon Member

    Hi Brogan! I paid a programmer to build a custom XF/WordPress integration where the story's forum thread is underneath my news story. When they click from thread page to thread page, I'm trying to have page anchors so it jumps down to the pagination/thread rather than reload to the top of the page where the news story is. All I need to figure out is how to append #page-anchor to the end of each page link, that's all.
     
  5. SurferJon

    SurferJon Member

    Can anyone help me with this? Thank you!
     
  6. tajhay

    tajhay Well-Known Member

    use thread marks addon
     
  7. SurferJon

    SurferJon Member

    I couldn't find a plugin named that. Can you post the link? Thank you!
     
  8. tajhay

    tajhay Well-Known Member

  9. SurferJon

    SurferJon Member

  10. SurferJon

    SurferJon Member

    Can anyone help?
     
  11. SurferJon

    SurferJon Member

    This code generates the pagination on a thread page (the numbers you click to go from thread page to thread page):
    Code:
    <xen:pagenav link="threads" linkdata="{$thread}" page="{$page}" perpage="{$postsPerPage}" total="$replycountxfwp}" unreadlink="{$unreadLink}" />
    So for example, each number is a link like this:
    https://xenforo.com/community/threa...4-more-assorted-improvements.79604/page-5

    What I want to do is add a page anchor to the end of the link, like this:
    https://xenforo.com/community/threa...4-more-assorted-improvements.79604/page-5#top

    But simply adding "#top" to the above code breaks the links. :( Does anyone have any ideas on how I can add this to the end of each of those links? Thank you!
     
  12. SurferJon

    SurferJon Member

    Actually is it possible to do this with the URL route filters?
     
  13. semprot

    semprot Active Member

    When i clicked the example link with #top, the link works & opened in the browser.
    Or did i miss something? :)
     

Share This Page