Modules

Smarty Plugin - Blocks anywhere v1.1

trabis  06-Apr-2009 21:00 9216 Reads   7 Comment(s) 
"Blocks anywhere" is a smarty plugin that provides an easy way to place a block in a theme or template.

Just upload this smarty plugin to class/smarty/xoops_plugins folder and you will be able to add a block using the following method:
<{block id=1}>


Replace '1' by the id of the block you want to display.

You can find id of block in blocks administration(or groups), just hover the mouse over block 'EDIT' link and you will see something like this:

.../modules/system/admin.php?fct=blocksadmin&op=edit&bid=3

This plugin respects XOOPS permissions. It will only display the block for users that are allowed to see it(as set in groups permissions).

This plugin also takes in consideration cached blocks.

Version 1.1 brings you some new cool options such as:

display = 'title' -> shows just title
display = 'none' -> renders the block but does not display it
options = 'enter|block|options' -> overwrites block default options
groups = 'enter|allowed|groups' -> overwrites block default group view permissions
cache = 3600 -> overwrite cache time(in seconds)

Code examples:
<{block id=1 display="title"}>   displays just the block title
<{block id=1}>                   displays just the block content
<{block id=7 display="none"}>    does not display nothing but executes the blockthis can go for online block or to trigger some cron block
<{block id=600 groups="0|1" cache=20}>  display block just for this 2 groups and sets a cache of 20 seconds
<{block id=600 options="100|100|s_poweredby.gif|0"}> displays block with diferent options


Usage example:
Place your 'multimenu' block in your theme.
Invisible online block that updates online users table.
Add an image gallery block inside article category page.
Add users online block into yogurt profile page
Etc...

No demo available, just try it!

Download it at Xoops User Utilities

Rating 5.00/5
Rating: 5.0/5 (1 vote)
Voting is disabled!


Login

Who's Online

176 user(s) are online (7 user(s) are browsing Publisher)


Members: 0


Guests: 176


more...

Donat-O-Meter

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

Latest GitHub Commits

Categories