1
tatane
function.block.php and My tabs
  • 2010/5/10 13:27

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1


Hello
I am currently working on a version xoops 2.4.4 with my module tab. I would like to display the tab on my block a specific spot in my theme. For this, I put the smarty <(block id = 155)> but it does not work! by cons if ever the smarty of other blocks it works!

function.block.php Does it work with my tab?

thank you in advance

2
trabis
Re: function.block.php and My tabs
  • 2010/5/10 17:56

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


That smarty plugin does not work with blocks that need to assign javascript or styles into header(using $xoTheme) so, no.

If you are using 2.4.x that you can use defacer module. Defacer has a preload that hooks in the block render system and that allows to assign any block content to a smarty variable.

Read defacer readme.txt for more information:

Tips for blocks anywhere (xoops 2.4 only)
=========
Just prefix your block title with an underscore and you will be able to use it has a smarty variable inside your theme or template
Example:
-Edit "User menu" block and rename it to "_User Menu"
-Take notice of the "bid" in the url, in this case it is '1':
modules/system/admin.php?fct=blocksadmin&op=edit&bid=1
-Usage on theme/template:
<{$xoops_block_1.title}> --> echos User Menu
<{$xoops_block_1.content}> --> echos the block content

Blocks that are assigned to smarty variable are not displayed in the blocks layout, that means that:
- the block must be set to visible
- you can enable or disable your block without need to remove the code from template or theme!
- you can change block configuration just as any other block, the only option that does not work is position, the reason is obvious!


Resume:
_Block name -> rendered into a smarty variable
Block name -> rendered into xoops block system

3
tatane
Re: function.block.php and My tabs
  • 2010/5/11 13:07

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1


nice,thank you

Login

Who's Online

631 user(s) are online (35 user(s) are browsing Support Forums)


Members: 0


Guests: 631


more...

Donat-O-Meter

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

Latest GitHub Commits