We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28676
    • 136 Posts
    I have an external php file (still within same site) that inside I would like to show a tv, but its not getting passed is this possible.

    Basically i`m passing a url string

    jump.php?m=hello 


    then in the php file

    if ($m == "[*affiliate*]")


    The call to the tv isnt working, how could I get round this?
      I made my first site with modx
      ------------------------
      http://www.shop-bright.com | Uk shopping blog
      • 31037
      • 358 Posts
      My (probably stupid) guess is that you can’t work directly with a TV in php code like that. Continuing my stupid guesses I would think you need to work trough the API, i.e. $modx->getTemplateVar or similar.

      Don’t know why I’m answering this when I’m just a newbie, but I can’t stop my self laugh

      Sorry smiley
        • 28676
        • 136 Posts
        I guess the api thing must be the way but I dont have a clue how to implement I did find this

        $tv_source = $modx->getTemplateVar($name);

        but cant get it to work.
          I made my first site with modx
          ------------------------
          http://www.shop-bright.com | Uk shopping blog
          • 31037
          • 358 Posts
          Until you get a real answer from someone prominent wink I can keep on guessing.

          The return from such api call is an array. Maybe if you do a
          print_r($modx->getTemplateVarOutput($); (or possible the getTemplateVars or getTemplateVars) it could give you a hint.

          Once again, I’m just guessing, at least it keeps this tread bumbed up laugh

          EDIT: And it gave my en extra star, 100 posts already... smiley
            • 28676
            • 136 Posts
            Can someone shed some light of this for me? Basically I have a php file that I have uploaded into my site root.

            A user is on a content page and they jump to a link jump.php?m=[*name*] the name is a tv that just passes thu something like "car" or "shop" but the php file will take the word car and assign a tv with the real url like "http://www.realurl.com" from the record id they clicked on.

            But I dont know how to get the record id and then the accociated real url.

            Help, its driving me mad.
              I made my first site with modx
              ------------------------
              http://www.shop-bright.com | Uk shopping blog