Start ::
Developers Corner ::
0.8 Theme Design ::
Missing variables in Override Block Template
Moderated by: Support Team
-
- rank:
-
pnFreshman
- registered:
- May 2006
- Status:
- offline
- last visit:
- 27.04.07
- Posts:
- 8
Hi I'm trying to override the Who's Online block within a theme. Here's what I've done:
1) Placed template users_block_online.htm in theme/MyTHEME/templates/blocks/
2) Changes master.ini to include
I can make changes to the layout etc. but unfortunately I'm not seeing any of the variables. For example the . I get "You are logged in as "
Have I missed a step?
-
- rank:
-
pnSoftmore
- registered:
- August 2002
- Status:
- offline
- last visit:
- 24.12.07
- Posts:
- 85
you are confused with users_block_online.htm and rsblock.htm.
users_block_online.htm is used by online.php
rsblock.htm is used by theme template.(by blockposition plugin)
it means you can't use users_block_online.htm in master.ini
it's useless because at this step, only $title, $content are passed to users_block_online.htm
therefore
[blocktypes]
online = users_block_online.htm
shoulld be
[blocktypes]
online = rsblock.htm
thanks
s. moon -
- rank:
-
pnFreshman
- registered:
- May 2006
- Status:
- offline
- last visit:
- 27.04.07
- Posts:
- 8
Thanks for your reply. So are you saying that there is no way of changing for example what the Who's Logged In block looks like... i.e override the template for that block?
Sorry for the stupid questions, I'm still finding my way around.
Found this related post about the menu block which is want to change also
http://community.postnuke.com/index.php?module=Forum&func=viewtopic&topic=48409&highlight=override%20menu%20block%20template
Tried placing the overriden template for the menu block in the place suggest, but no joy!
Help?! -
- rank:
-
pnSoftmore
- registered:
- August 2002
- Status:
- offline
- last visit:
- 24.12.07
- Posts:
- 85
sorry for insufficient explanation.
After creating rsblock1.htm,
in this template, with using pnModAPI() and plugins
you can modify rsblock1.htm
for your purpose.
thanks
s. moon
edited by: imoon, Apr 08, 2007 - 04:50 PM -
- rank:
-
pnFreshman
- registered:
- May 2006
- Status:
- offline
- last visit:
- 27.04.07
- Posts:
- 8
Thanks for your response.
Sounds like I have to re-write the block! I'm really not much of a programmer. Would have thought there should be an easy way to change the layout of a system block displayed on the right. That's all I want to do! Change the layout of the Who's online and Login block. -
- rank:
-
Moderator
- registered:
- March 2002
- Status:
- offline
- last visit:
- 24.04.08
- Posts:
- 7647
There are two templates involved in each block.
1) (optional) The block wrapper provided by the theme. Themes don't need this one but some will provide it if the default isn't sufficient. This template provides the markup in which the block output is placed. The default internal block template is simply a header (h4 tag) containing the block title and the block content.
2) The block content template. This template is specific to the block type (e.g. the online block in this case...) and is provided by the module rather than the theme. Overriding this template is possible using the same template override procedure as you use for any module function.
In this specific case you copy system/Users/pntemplates/users_block_online.htm to themes//templates/modules/Users/users_block_online.htm. Then edit the template in the theme as needed.
The following Wiki articles should help you get to grips with the template structure
- http://communit...verridng.htm
- http://communit...eAnatomy.htm
- http://communit...mponents.htm
- http://communit...emplates.htm
-Mark
Start ::
Developers Corner ::
0.8 Theme Design ::
Missing variables in Override Block Template
