We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36455
    • 1 Posts
    I have set up a blog which has a tag list which when you click on a tag it displays blogs related to the tag. All pretty straight forward and using getresources etc.

    What I want to do is display the current tags being viewed at the top of the page! Does anybody know how to do this?

      • 33968
      • 863 Posts
      There's no built in functionality that will do this for you. Perhaps set the currently viewed tag as a $_SESSION variable (for each user) as it is stored in the database, then use $modx->getIterator('modSession') to grab the current users and pull out the unique tags.

      I'm not sure how this will impact on performance though as it will have to run uncached on every page load for your blog.

      Maybe someone else has a better idea?