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

"Custom Templates" and <xen:include

Discussion in 'XenForo Development Discussions' started by Jeremy, Mar 9, 2011.

  1. Jeremy

    Jeremy XenForo Moderator Staff Member

    OK, so I am working on how to accomplish building a new "custom template" help option. Can I do a dynamic "<xen include=" or do I need to build the template via PHP and pass that along to my template?
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Bobster confirmed my suspicions that I needed to do it via PHP. I thought I read that <xen: syntax was converted at compile, but wasn't 100% sure.
     
  3. Jaxel

    Jaxel Well-Known Member

    I use dynamic templates in mods all the time...
     
  4. Bob

    Bob Well-Known Member

    he wanted to do this.. <xen:include template="{$var}" /> that won't work.
     
  5. Jaxel

    Jaxel Well-Known Member

    Oh... yeah... you can't do that... look at my portal mod, in /EWRporta/ViewPublic/Portal.php
    Code:
    $object = $this->createTemplateObject($template_name, $params);
     
    Bob likes this.
  6. Bob

    Bob Well-Known Member

    Checking it out now :D Thanks Bro!
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    Yep. :) I was hoping that I could be lazy and not use that.
     

Share This Page