1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

question - what do I do when a needed var is not avail in a template

Discussion in 'Styling and Customization Questions' started by Mutt, Feb 24, 2012.

  1. Mutt

    Mutt Well-Known Member

    I'm in template editor_dialog_media. it's the little popup you get when you click the media button to embed a video. I wanted to hide some of the available sites that you can embed in the majority of the forums & just show them in my adult forum. seemed like it would be real easy to throw up a if node = deal but evidently, node is not available here. I tried $forumId, $forum.node_id, & for fun I even tried $thread.node_id. Only var I really see in the template other than visitor is $site but it didn't know $site.node_id.

    what are my options? do I really need an addon for this or is there some cool xen way to suck in the var?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You would have to extend this controller:


    The $viewParams in that function are what define the available variables. The forum record is not available by default.
  3. Mike

    Mike XenForo Developer Staff Member

    That page isn't forum-specific, so you'd have to go hacking the JS and editor templates too...
  4. Mutt

    Mutt Well-Known Member

    thank you both

Share This Page