Jump to Main Content
Content > XOOPS > Block Anywhere - XOOPS - Smarty Templates
Block Anywhere - XOOPS - Smarty Templates

Display a XOOPS block anywhere on your site — in your theme or in your templates — using Smarty. There are even over-riding options providing excellent control for your site(s).

Latest Version - 1.1 (Trabis)

I first saw this method used by Herve. Then the version done by Catzwolf using Smarty — a better way to make it happen. Now comes this version by Trabis which adds some different variables and control. I'll note that the versions by Trabis and Catzwolf work essentially the same — using Smarty plugins— but with different variable options. Because of how they are written and called, they may also be used interchangeably.

This solution should work in almost any later version of XOOPS, generally, because it pulls in a block using XOOPS conventions through the Smarty code. I know it worked in 2.0.x and also works in 2.3.x.

Installation

Copy the php file to /class/smarty/xoops_plugins folder. Insert the smarty code in your theme and/or templates. Read the readme.txt (Catzwolf) or php file (Trabis) to find the various options available.

Trabis' Version

Usage:

<{block id=x [options]}>

where x is the ID of the block and [options] is replaced by one or more of the available options (if desired).

Options:

  • display = 'title' — shows just title
  • display = 'none' — renders the block but does not display it
  • options = 'enter|block|options' — override block's default options
  • groups = 'enter|allowed|groups' — override block's default group view permissions
  • cache = 3600 — override cache time (in seconds)

Catzwolf's Version

Usage:

<{xoops_block block='x' [options]}>

where x is the ID of the desired block and [options] is replaced by one or more of the available options (if desired).

Options:

  • title='false' — shows only content (without title)
  • titleclass='classTitle' — applies classTitle css style to title
  • contentclass='classContent' — applies classContent css style to content

Other Pages
Previous Page Article - XOOPS News/Blogs Module XOOPS 2.3.x Overview, Installation, and Upgrade (from 2.0.x) Next Page
 
Comments are solely the opionion of the author and not to be construed as the opinion of anyone else.
Login
 

 

 

(c) 2006-2007 - Mark Boyden
Privacy - Legal Stuff - Contacts