We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42681
    • 64 Posts
    Is there any way to retrieve in a snippet or chunk from where the chunk or snippet was called?

    We call a chunk from different TVs and need to know from which TV the call was done to use different values in the chunk depending from which TV the call was done.

    Does anybody have an idea how to do this? Would be great smiley
      • 4172
      • 5,888 Posts
      what do you use, to call it from TV?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 42681
        • 64 Posts
        Quote from: Bruno17 at Jun 25, 2015, 06:21 AM
        what do you use, to call it from TV?

        e.g.
        [[$chunk-name]]


        What we would like to avoid is to transfer the tv-name from where the call is done manually e.g. like this:
        [[$chunk-name? &tv-name=´box1´]]


        It would be great if it is possible to receive `box1` automatically in the chunk by just using the call
         [[$chunk-name]]
          • 4172
          • 5,888 Posts
          Quote from: gemand at Jun 25, 2015, 06:49 AM

          What we would like to avoid is to transfer the tv-name from where the call is done manually e.g. like this:
          [[$chunk-name? &tv-name=´box1´]]


          this would have been my suggestion.
          Why not this way?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 42681
            • 64 Posts
            Quote from: Bruno17 at Jun 25, 2015, 07:25 AM

            this would have been my suggestion.
            Why not this way?

            If there is no other way we would do it like you proposed. The reason why we want to avoid to manually add the `source` in the chunk-call is that we often copy/paste the content from one TV to another which would be error-prone if this is not done automatically ...
              • 4172
              • 5,888 Posts
              would need to know more about the whole situation.
              Maybe there are ways to get there.

              For example, you could call the TV with a snippet, which would set a placeholder with the tvname, before parsing and outputting the TV-content, which you would call like:

              [[getTV? &tvname=`yourTV`]]


              Not sure, if it is possible to call the TV directly with

              [[*yourTV? &tvname=`yourTV`]]


              and if the placeholder
              [[+tvname]]

              would be available within the chunk automatically

              or if you need to have all chunks with

              [[$chunk-name? &tvname=´[[+tvname]]´]]


              then





                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 4172
                • 5,888 Posts
                this seems to work:

                [[*tvname-test? &tvname=`tvname-test`]]


                then you can use the placeholder

                [[+tvname]]
                in your chunk to get the calling tvname

                but, if you call that chunk multiple times at the same page, you will need to have a unique footprint for each.
                So you will need:

                [[$tvname_test? &tvname=`[[+tvname]]`]]


                It is also possible to give your chunk a default-property 'tvname' with the value '[[+tvname]]'

                then
                [[$tvname-test]]
                seems to be enough [ed. note: Bruno17 last edited this post 11 years, 3 months ago.]
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!