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

XF 1.4 How to convert New Posts into Recent Posts

Discussion in 'Styling and Customization Questions' started by webducknj, Apr 17, 2015.

  1. webducknj

    webducknj Active Member

    Hi folks,

    Was just wondering if someone could point me in the right direction, I'm trying to recode the New Posts link (in the Navbar) to show the Recent Posts (on the right, just above the forums head) results. Once this is done I'd like to comment out the Recent Posts link so it won't be there.

    Can someone just point me in the right direction as to where the code would be for these two forums features?

    Thank you,
  2. webducknj

    webducknj Active Member

    just found this line in the Navigation template

    <li><a href="{xen:link 'find-new/posts'}" rel="nofollow">{xen:if $visitor.user_id, {xen:phrase new_posts}, {xen:phrase recent_posts}}</a></li>

    was thinking I'll just have the conditional return recent_posts whether the visitor has a user id or doesn't. that should work, no? any reason from the system's perspective as to why this would be a bad idea?

    thank you!
  3. Brogan

    Brogan XenForo Moderator Staff Member

  4. webducknj

    webducknj Active Member

    Brogan, One thing stat still confuses me is where text would be modified. Where does the actual code/text reside that makes "New Posts" display as such? It's HTML right? I can make CSS changes and sometimes I'm successful modifying templates but the HTML seems like it should be the easiest to find and change but I'm not usually successful.

  5. Brogan

    Brogan XenForo Moderator Staff Member

    As it explains in the resource:

  6. webducknj

    webducknj Active Member

    reading into your reply a little, because i hope you'll give me the benefit of the doubt that i already searched and re-searched the navigation template :) , i found this little gem which does have an effect on the actual displayed text

    xen:phrase recent_posts

    but when i change it, whatever trickery was making recent_posts display as 'Recent Posts' no longer has the same effect even if I match the recent_posts format.
  7. webducknj

    webducknj Active Member

    made the changes and waiting to get some feedback from the membership if they approve of my handiwork :)

    thanks for the help Brogan
  8. webducknj

    webducknj Active Member

    @Brogan no comment on why recent_posts reformats to display Recent Posts but other text doesn't?
  9. Brogan

    Brogan XenForo Moderator Staff Member

    I don't really understand what you're asking.
  10. webducknj

    webducknj Active Member

    in the original template it has {xen:phrase recent_posts} and the actual link in the navbar displays as Recent Posts

    when I put in {xen:phrase active_threads} it displays Active_Threads...it doesn't auto format as it did with the original text
  11. Brogan

    Brogan XenForo Moderator Staff Member

    You need to create the phrase if it doesn't exist.
    Amaury likes this.
  12. Amaury

    Amaury Well-Known Member

    As a suggestion, prefix custom phrases with your site initials so you know which ones are custom.

Share This Page