Get XOOPS XOOPS FAQ Forums News Themes Modules
News World of XOOPS Developers Hacks Modules Themes Archive Submit News

XOOPS vs. Herko Coomans

Make a donation

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Search

Local Support Sites

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Google GUI hacks instant-zero jQuery module news Nordic Olédrion oxygen PageRank security SEO simple-XOOPS sport tag Theme wiki xoops

New Users

Registering user

# 96568

dvsshoescom

Welcome to XOOPS!

Archives

XOOPS Code hosted on SourceForge

Smarty Plugin - Blocks anywhere v1.1

Posted by trabis on 2009/4/8 9:50:00 (2767 reads) | Posted on Modules
"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


Printer Friendly Page Send this Story to a Friend Create a PDF from the article


Bookmark this article at these sites

                   

The comments are owned by the poster. We aren't responsible for their content.

Smack !!
Posted: 2009/4/6 18:01 • Updated: 2009/4/6 18:01
Trabis, you're D'Man!!!!

That sounds very promising!

I'll be testing it soon!
Posted: 2009/4/6 19:10 • Updated: 2009/4/6 19:10
Great idea and great work !
Posted: 2009/4/7 2:40 • Updated: 2009/4/7 2:40
super. that will do things easier...
Posted: 2009/4/7 3:06 • Updated: 2009/4/7 3:06
Good idea.
I also have a smarty block plugin and ajax block plugin .
You can have a check here .

http://www.ncnynl.com/xoops2016u/modu ... e/view.article.php?120/c2

writed by chinese. but you can have a look the code and easy to know and use.
Posted: 2009/5/5 23:08 • Updated: 2009/5/5 23:08
hi community,

is this block plugin working with xoops 2.2.5RC3, too?
Posted: 2009/7/14 7:12 • Updated: 2009/7/14 7:12
Thank you ,
My Quastion in wht way can i use this Hack without Having to Place the Plugin inside the Smarty Plugin folder .

If someone Has Made a Module and would Like to adopte the Hack to the core of his Module ..
Posted: 2009/8/21 22:57 • Updated: 2009/8/21 22:57