We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36541
    • 222 Posts
    Any idea on my template issues: #1 and #2 above?
      This is the web: the only thing you know about who will come is that you don't know who will come.
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: gadamiak at Mar 23, 2011, 06:30 AM

      Any idea on my template issues: #1 and #2 above?
      When iterating, this is not going to work, because if you uncache it, it will be delayed until your data goes out of scope, and if you don’t have a unique tag signature to call the chunk with and you do cache it, it will simply get pulled from the cache. Try adding a unique property, e.g. &n=`[[+idx]]` on the tag string to call the Chunk and see if that resolves either situation...
        • 17631
        • 4 Posts
        I need to make a unique template for the current link in the menu. Or just add to the current menu item "class = current". How can I do this? Will there be a possibility in the future?

        Earlier, I did it with "tpl_{n}", but for a large and frequently changing menu, this is not convenient.

        Sorry for my English, translated for an interpreter...
          • 36541
          • 222 Posts
          Quote from: OpenGeek at Mar 23, 2011, 08:50 AM

          Try adding a unique property, e.g. &n=`[[+idx]]` on the tag string to call the Chunk and see if that resolves either situation...

          That works, thanks. For anyone interested here is the working setup:

          &tpl = `res.list`:
          ...
          
          &tplFirst = `res.list-first`:
          Some content before the list...
          [[$res.list?n=`idx`]]
          
          &tplLast = `res.list-last`:
          [[$res.list?n=`idx`]]
          Some content after the list...


          However, when using getPage this doesn’t help. I guess the solution would be similar, but I didn’t figure it out. How to deal with getPage?
            This is the web: the only thing you know about who will come is that you don't know who will come.