PostNuke: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  Developers Corner ::  0.8 Theme Design ::  Missing variables in Override Block Template

Moderated by: Support Team

Bottom
Missing variables in Override Block Template

  • Link to this postingPosted: 07.04.2007, 13:27
    Profile
    sspanchal
    rank:
    pnFreshman 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
    Code
    [blocktypes]
    online = users_block_online.htm

    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?
  • Link to this postingPosted: 07.04.2007, 15:37
    Profile Homepage
    imoon
    rank:
    pnSoftmore 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
  • Link to this postingPosted: 08.04.2007, 15:17
    Profile
    sspanchal
    rank:
    pnFreshman 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. icon_confused

    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?!
  • Link to this postingPosted: 08.04.2007, 16:38
    Profile Homepage
    imoon
    rank:
    pnSoftmore 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
  • Link to this postingPosted: 12.04.2007, 15:15
    Profile
    sspanchal
    rank:
    pnFreshman 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.
  • Link to this postingPosted: 12.04.2007, 15:30
    Profile Homepage
    markwest
    rank:
    Moderator 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



    -Mark
  • Link to this postingPosted: 20.04.2007, 17:22
    Profile
    sspanchal
    rank:
    pnFreshman pnFreshman
    registered:
     May 2006
    Status:
    offline
    last visit:
    27.04.07
    Posts:
    8
    Cheers for that. That clarified everything. I was putting the template in the wrong place - in /config/templates/system/!!

    Thanks icon_smile

Start ::  Developers Corner ::  0.8 Theme Design ::  Missing variables in Override Block Template

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to PostNuke