Fork me on GitHub

Conditional statements for Xanthia and News  Bottom

  • I have a template set upin Xanthia for the news module. I would like to be able switch the block zone at the top of each category page in the news module. I have tried to use the following in the xanthia template for the news module:

    Code

    !--[if $catid eq "2"]-->
    <!--[$CHSCAT]-->
    <!--[/if]-->


    However, it doesn't seem to work for me.

    Do I have access to the $catid variable from the xanthia theme? If not, how can make this logic work? Any suggestions would be appreciated!
  • I finally figured it out. I looked through some other themes. Here is the answer..






    I guess I'm still not sure I understand how this is works...does anyone have some documanetation that might help me understand the use of variable in the xanthia themes? or is this part of PN Render? I'm a novice at the new themse and template system. Any advice or direction to good resources would helpful!

    Thanks!
  • This is part of pnRender, your only problem was not knowing how the variable was contained (in this case part of an associative array). To find out which variables are available to any template simply insert into the template and load the page, you will get a popup window of all the available arrays neatly listed for you.

    pnRender is a postnuke specific API for Smarty, to learn how to use Smarty (and thereby pnRender) see the Smarty Documentation. Just substitute thier curly bracket tags {} with PN's custome tags and your golden.

    Once you've got the basic logic constructs down have a look at the directory modules/pnRender/plugins for PN specific plugins that any template can use. You can also use the plugins in modules/Xanthia/plugins for Xanthia themes. And if you have a look at the SeaBreeze theme you'll see that you can have custom theme plugins as well.

    I may also be starting up a pnRenders Anon to help those more seriously addicted to pnRender... have fun.

    --
    Under Construction!

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