1
4dept
Using template in template
  • 2005/11/24 8:07

  • 4dept

  • Just popping in

  • Posts: 4

  • Since: 2005/11/13


I have 2 smarty templates for editing and deleting records (confirmation), which should show the record and edit or delete it: /templates/admin_areas_edit.html and /templates/admin_areas_delete.html

So, i decided to write 3rd template for displaying current record - /templates/admin_areas_form.html - which is used by both modules to optimize code.

Main script is admin_areas.php, which in case of $action parameter shows one of another template:

if ($action == "edit")
{
//start edit record

// include template
$xoopsOption['template_main'] = 'admin_areas_edit.html';

// ...
}
else
{
//confirm deleting

// include template
$xoopsOption['template_main'] = 'admin_areas_delete.html';

// ...
}

Both templates include 3rd and set some parameters:
<{include file="db:admin_areas_form.html" ok_name="edit_done" ok_value="Edit" no_value="Reset" action="edit"}>

Templates 'admin_areas_form.html' is also listed in xoops_version.php.

So, after instaling module (PHP debug mode), it's installed with 2 messages in installation log:
Warning [Xoops]: Smarty error: unable to read resource: "db:admin_areas_form.html" in file class/smarty/Smarty.class.php line 1084

Scripts work right without any debug errors or bugs.

Why so and is it important?

2
4dept
Re: Using template in template
  • 2005/11/24 8:14

  • 4dept

  • Just popping in

  • Posts: 4

  • Since: 2005/11/13


I'm sorry, i have found the answer:
https://xoops.org/modules/smartfaq/faq.php?faqid=426

Login

Who's Online

247 user(s) are online (179 user(s) are browsing Support Forums)


Members: 0


Guests: 247


more...

Donat-O-Meter

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

Latest GitHub Commits