1
flymirco
Smarty template in the admin section of a module
  • 2008/11/22 21:53

  • flymirco

  • Just popping in

  • Posts: 42

  • Since: 2006/9/20


Hi all,

is there a way to use smarty template in the admin section of a module?
I looked at some old post but the informations founded wasn't helpful.

flymirco

2
trabis
Re: Smarty template in the admin section of a module
  • 2008/11/22 22:39

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Yes there is,
In your admin file add this lines:
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
    include_once(
XOOPS_ROOT_PATH."/class/template.php");
    
$xoopsTpl = new XoopsTpl();
}


After that you can assign template vars as usual.

At the end of the file use this:
$xoopsTpl->display'db:your_template_name_here.html' );


You must declare that template in the module's xoops_version.php as you do for any other template and use this code after xoops_cp_header(); and before xoops_cp_footer();

3
flymirco
Re: Smarty template in the admin section of a module
  • 2008/11/23 12:09

  • flymirco

  • Just popping in

  • Posts: 42

  • Since: 2006/9/20


Thank you so much trabis, it works fine!

Xoops rocks!

PS: I make a FAQ in the Italian XOOPS Support Community website with your tips, visible at XoopsItalia.org

flymirco

Login

Who's Online

313 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 313


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits