We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7934
    • 2 Posts
    I’m having trouble with TV widgets. I’ve tried 2 separate ones and both are only passing 1 character - when there should be a whole word or even HTML block. I used both the Sidebar Widget tutorial http://wiki.modxcms.com/index.php/Adding_TV_Widgets_without_hacking_the_core and the addCssWidget http://modxcms.com/addCssWidget-0.5-1156.html and I get the same results. The only thing passed through from the TV to the HTML is 1 character (I think it’s even the 2nd character in whatever the output string should be).

    With the addCssWidget, my output would include the link tag generated from the snippet, but the actual output would look like the following. (The "/css/" is in the snippet as the default folder, so the only part coming from the TV is the "o" character- it should be "portfolio.css")
    <link href="/css/o" rel="stylesheet" type="text/css" media="screen"  />

    Same thing happens with the sidebar widget from the Wiki tutorial. I put the following into the RTE editor for the sidebarTV, but only a single "p" character comes out in the front end.
    <p>sidebar content here</p>

    Anybody have any ideas? I get the same issue on both my local testing server (Mac OS 10.5 with PHP5 and latest MySQL) as well as my VPS web host (same setup but on Linux - can’t remember the flavor at the moment).

    I’m using MODx 0.9.6.1p2

    Thanks for your help!
    Daniel
      Daniel
      Artesian Design
      • 4310
      • 2,310 Posts
      That caught me out.
      It should be
      $tvOutput = $TVarray[$TVname];
      

      Not
      $tvOutput = $TVarray[$TVname][1];
      
      which restricts the result to one character.
      I have edited the Wiki entry.
        • 7934
        • 2 Posts
        Awesome, that was it! It was the same issue in both snippets.

        Thanks for the quick reply! You Rock!
          Daniel
          Artesian Design
          • 4310
          • 2,310 Posts
          Happy to help grin