11
alain01
Re: XOOPS 2.5.9 Notes for Theme Creators
  • 2019/11/11 0:16

  • alain01

  • Just can't stay away

  • Posts: 536

  • Since: 2003/6/20


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...

12
geekwright
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.

13
alain01
Re: XOOPS 2.5.9 Notes for Theme Creators
  • 2019/11/12 1:03

  • alain01

  • Just can't stay away

  • Posts: 536

  • Since: 2003/6/20


Thank you for this advice !

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

14
alain01
Re: XOOPS 2.5.9 Notes for Theme Creators
  • 2020/4/8 10:41

  • alain01

  • Just can't stay away

  • Posts: 536

  • Since: 2003/6/20


Quote:
geekwright wrote:
There is a XoopsFormRendererBootstrap4 that will be included in 2.5.11

you can copy the file XoopsFormRendererBootstrap4.php into your theme's directory and use:
include_once 'XoopsFormRendererBootstrap4.php';
XoopsFormRenderer::getInstance()->set(new XoopsFormRendererBootstrap4());
Ok, i 've tried on XOOPS 2.5.10
but it was not clear for me, i believed that i should modify theme.tpl...

But, in fact, we should modify the theme_autorun.php file like that :
/*
xoops_load('XoopsFormRendererBootstrap4');
XoopsFormRenderer::getInstance()->set(new XoopsFormRendererBootstrap4());
*/
include_once 'XoopsFormRendererBootstrap4.php';
XoopsFormRenderer::getInstance()->set(new XoopsFormRendererBootstrap4());

and NOW, it's ok !

(No need action for xoops 2.5.11*)

Login

Who's Online

349 user(s) are online (235 user(s) are browsing Support Forums)


Members: 0


Guests: 349


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