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

$externalDataUrl in templates?

Discussion in 'XenForo Development Discussions' started by Jaxel, Jan 16, 2012.

  1. Jaxel

    Jaxel Well-Known Member

    How do I call $config['externalDataUrl'] in my templates?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can use this in the PHP code to get that value:

    Code:
    XenForo_Application::get('config')->externalDataUrl
    
    But I don't see any default or container params with the config information (for use in the templates).
     
  3. Jaxel

    Jaxel Well-Known Member

    I would rather not have to do it in PHP code... otherwise I have to start editing TONS of files to pass it.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You could use the container_public_params event to add it to the container params. That would allow you to access the variable in PAGE_CONTAINER and other included templates. But if you need it in your content template then you need to add it to the controller, in a _postDispatch function perhaps (to affect all actions). Or maybe the front_controller_pre_view event will work as it has access to the controllerResponse.
     
  5. Jaxel

    Jaxel Well-Known Member

    Bah, I solved it by simply making my own helper:
    Code:
    <img src="{xen:helper medio, $media}" />
     

Share This Page