Announcement

Collapse
No announcement yet.

Detect specific template that is calling component

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Detect specific template that is calling component

    Is there a way to detect which template is calling a component module? I was thinking something on l.settings would be logical.

    I need to run conditional code based on 'who' is calling. Is this possible?
    Gordon Currie
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
    phosphormedia.com

    #2
    I asked Dev and was told it's not possible.
    Thanks,

    Rick Wilson
    CEO
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Isn't there a setting, l.settings:page:code or something, that tells you the code of the page that's currently being rendered? That may not be a complete solution, but it should help in some cases.
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment


        #4
        I think both statements are correct. While you can not tell exactly which template within a page is being run, you should be able to tell which page is running.

        To detect which template is executing you will either have to set a variable or pass a parameter within the component token.

        <mvt:item name="mymodule" param="globalfooter" />


        Last edited by RayYates; 09-29-16, 05:14 AM.
        Ray Yates
        "If I have seen further, it is by standing on the shoulders of giants."
        --- Sir Isaac Newton

        Comment


          #5
          Originally posted by RayYates View Post
          To detect which template is executing you will either have to set a variable or pass a parameter within the component token.

          <mvt:item name="mymodule" param="globalfooter" />
          I was hoping that somehow this was already being done automagically. I need the template that is calling into the item.
          Gordon Currie
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment

          Working...
          X