Fork me on GitHub

pnRender and Blocks  Bottom

  • Hi,

    When creating new blocks, should they be templated with pnRender? I scanned through some of the modules/blocks in Postnuke 0.76 and they all look like they are using pnHTML.

    If anyone has a block done via pnRender, I'd like to take a look at it and see how it's done.

    Thanks,
    Grant
  • An pnrender example block is supplied with the Example module, included in 0.760 .
    The best, and easiest way to do it is to use pnRender.
  • Sweet, I just checked it out and will start working with it soon.

    I am writing a module and will have a block associated with the module to be included on the front page. For my module, I'm using a custom pnstyle/style.css sheet. If I write my block with the custom CSS tags, will they be pulled in for the block when viewed on the front page?

    Thanks,
    Grant
  • No - loading a block will not (currently) trigger the linking of the module stylesheet. This is only available for the full module. However you can force a module stylesheet to be linked explicitly via a template tag. The following tag will link style.css from the module 'mymod'. Add this to the page templates of the theme (or the header_footer module page template for non Xanthia themes).

    Code

    <!--[modulestylesheet modname=<mymod>]-->


    You can also define the filename of the stylesheet to use a different stylesheet.

    Code

    <!--[modulestylesheet modname=<mymod> stylesheet=aardvark.css]-->


    Lastly the module can define the default stylesheet to be loaded (instead of style.css) by defining the 'modulestylesheet' module var (i.e. pnModSetVar('mymod', 'modulestylesheet', 'wibble.css'); )

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Just to add a little note about styles for blocks. The problem with imlementing a similar setup to the module stylesheets is one of performance. If we take a site with 10 blocks from 5 different modules then we have to check a fair number of paths to find if a stylesheet exists for each block. Additionally we'd probably have to query the database to find what blocks (and thier associated module) are active.

    I'm not ruling this out but there a number of issues that would need to be looked at carefully prior to any implementation. Could you log this as a feature request at noc.postnuke.com.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Mark,

    I guess I'm a noob. I have an account at noc.postnuke.com, but where do I log a feature request?

    Thanks,
    Grant
  • Look at the development resources block on each page here at postnuke.com.

    -Mark

    --
    Visit My homepage and Zikula themes.

This list is based on users active over the last 60 minutes.