We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46668
    • 51 Posts
    Hi

    Need a little guidance, I am using siblingNav and instead of changing the defaults chunks to what I need I want to add my own in case this gets updated as they would get over-written.
    The current placeholders are like this
    [[+sn.next]]

    But what would I change to use a custom chunk called sn.nextbutton or something that I have created, I have tried to few things without luck hence now here.

    Thanks

    Ian

    [ed. note: panfire last edited this post 12 years, 4 months ago.]
      • 3749
      • 24,544 Posts
      You need to set the tpl properties in the snippet tag to point to your custom chunk(s). For example:

      &nextTpl= `Mysnnext`


      Then create a chunk called Mysnnext by duplicating the snnext chunk. Call it Mysnnext and change the content of the duplicate to whatever you want.


      http://rtfm.modx.com/extras/revo/siblingnav
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 46668
        • 51 Posts
        ok I am not a programmer so I am trying to understand the following,

        The property for the next chunk is nextTpl which I presume is the variable name, and the default chunk that it uses is
        called snnext
        So why is the chunk that it uses in siblingnav/core/components/siblingnav/elements/chunks/ called snnext.chunk.html

        Am I meant to add the .chunk.html extension to whatever name I give the new chunk or can you help me understand that.

        Many thanks

        Ian
          • 3749
          • 24,544 Posts
          I'm not familiar with SiblingNav, but most components create chunks when installed, which in your case would probably be in in the SiblingNav folder under the chunks folder in the elements tree. The files you found are ignored in that case and the chunk itself is used.

          See if you find a chunk called snNext there in the Elements tree. If so, all you have to do is duplicate it, change the name of the duplicate to Mysnnext, modify it to meet your needs, and put its name in the &nextTpl property in the snippet tag.

          &nextTpl= `Mysnnext`


            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 4172
            • 5,888 Posts
            siblingNav first is trying to find a chunk with the the name defined with the &nextTpl - property

            If this chunk doesn't extist, it is searching for a file-based chunk with the name

            name.chunkSuffix

            the default chunkSuffix for file-based chunks is
            .chunk.html
            but can be changed by property.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 46668
              • 51 Posts
              OK I see thanks for the information.

              Have now been able to create my own chunks in the element tree in the siblingNav folder and pointing to them as per instructions above.

              Many thanks for the help much appreciated.

              Ian