Jump to content

Addon Module - Call Template from Output Function


jfreak53

Recommended Posts

I can't find it anywhere in the developer documentation but it does hint to the fact that in the _output function I can call a template file. How do I do this? I would like to call a template file for final output from the module directory.

 

Thanks.

Link to comment
Share on other sites

yes it can be done, have you checked the supplied templates as they document it i think.

 

basically you can either echo content, then exit the script (this wont include the sites header/footer).

 

or you can return an array like so:

 

return array(

'pagetitle' => $title,

'breadcrumb' => array($vars['modulelink'] => $vars['_lang']['page_title']),

'templatefile' => 'tplname',

'requirelogin' => 1,

'vars' => array('vars' => $vars)

);

 

its pretty self explanatory, but the templatefile is the name of the .tpl file in the module folder. breadcrumbs is an array link => anchor text. login is true/false, and vars allows you to assign additional smarty vars for use in the template.

Link to comment
Share on other sites

  • 10 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated