xoops forums

alain01

Quite a regular
Posted on: 11/11 0:16
alain01
alain01 (Show more)
Quite a regular
Posts: 308
Since: 2003/6/20
#11

Re: XOOPS 2.5.9 Notes for Theme Creators

Quote:

geekwright wrote:
New Smarty variables added in XOOPS 2.5.9


$xoops_page contains a condensed version of the current page name. For example, for http://myurl/index.php, $xoops_page would be "index". For http://myurl/modules/profile/edituser.php, $xoops_page would be "profile/edituser".

$xoops_startpage contains the module configured as the start page, or "system" if no module is selected.

A "rendered" key is now set by XoopForm assign() method

Some scripts use the assign() method as an alternative to the display() method. This method assigns the form details to a stem variable named with the form's name. This assignment is done with code that looks like this:

$form->assign($GLOBALS['xoopsTpl']);

This technique has often been done to give the theme more control over the display of the form. It requires the template to loop through the individual form elements, and decide how to display it. This level of control is good if you need it, but can be a nuisance if you just want to position the form inside the page, and you would prefer the system to handle the details.

Very usefull !
Just use now in XOOPS 2.5.11 beta + new theme that i'm working on (boostrap 4).

But how can i use $xoops_page
with
http://myurl/modules/xmcontent/viewcontent.php?content_id=2
and
http://myurl/modules/xmcontent/viewcontent.php?content_id=8

2 different links...

geekwright

Quite a regular
Posted on: 11/11 3:47
geekwright
geekwright (Show more)
Quite a regular
Posts: 283
Since: 2010/10/15
#12

Re: XOOPS 2.5.9 Notes for Theme Creators

The $xoops_page variable only gives the module and script. It was intended to allow adding menus or style variations for a specific function, not specific content.

If I needed the content_id exposed as well, I would probably ask Mage to add it to the smarty variables that xmcontent assigns.

alain01

Quite a regular
Posted on: 11/12 1:03
alain01
alain01 (Show more)
Quite a regular
Posts: 308
Since: 2003/6/20
#13

Re: XOOPS 2.5.9 Notes for Theme Creators

Thank you for this advice !

Here, by mage (little bug, it would be ok by mage next days)