Fork me on GitHub

Alternate header colours/background images for news articles  Bottom

  • Hi All,

    1st: Having put out a couple of standard postnuke themed sites up for charities, I got to say this CMS rocks! And thanks to the community for all the advice. I would have asked more stoopid questions but most of the answers are already here :D

    Now I want to start designing custom themes for personal use and public share so here's the question:

    Is it possible with the standard themes (or any 3rd pty themes) to alternate the colours/backgrounds used as the headers to the items within blocks (e.g. the news articles so that each heading has a different or alternating background colour or image)?

    An example: http://www.ipsem.com…/clients/nhsc/1.gif

    Thanks for all the support.

    Pete
  • appy

    Hi All,

    1st: Having put out a couple of standard postnuke themed sites up for charities, I got to say this CMS rocks! And thanks to the community for all the advice. I would have asked more stoopid questions but most of the answers are already here :D

    Now I want to start designing custom themes for personal use and public share so here's the question:

    Is it possible with the standard themes (or any 3rd pty themes) to alternate the colours/backgrounds used as the headers to the items within blocks (e.g. the news articles so that each heading has a different or alternating background colour or image)?

    An example: http://www.ipsem.com…/clients/nhsc/1.gif

    Thanks for all the support.

    Pete



    Yes it is if you use the Xanthia Theme Engine

    One of the limitations with PostNuke themes is you are limited to block styles and arrangements. With Xanthia you can assign a HTML template called a tpl file for each block you create. The Xanthia Theme Engine separates HTML from PHP so all you need to do is edit HTML template files to alter your page and block styles.

    You can change background colors by either choosing to use a java color picker in the Xanthia User Interface in the Administration Menu or you can hardcode color values in the block template styles and create new ones. I found the latter necessary when using many different color title headers for multiple blocks.

    There are 2 Xanthia tutorials available that explain how to edit block layouts and template styles here:



    Xanthia is in its early development stages. Soon you will be able to edit your template files through the browser rather than FTP. Other features such as new theme creation and assigning block template styles to blocks will also be made easier.

    Feel free to post any questions you may have at the Xanthia Forum at http://pnapi.com
  • Thanks m8, checking that one out now!

    Pete
  • Hi - this has likely long been resolved, but it's worth noting that you can easily acheive the alternating news block effect with "classic" PN themes...

    Just inside the themeindex() function (that displays the intro news blocks on the home page and topics) put:

    Code

    $GLOBALS['story_num']++;

    if ($GLOBALS['story_num']%2 == 1) {
    ?>
      HTML for "ODD" NUMBERED BLOCKS GO HERE
    <?

    } else {
    ?>
      HTML for "EVEN" NUMBERED BLOCKS GO HERE
    <?
    }

    Note the
  • 0 users

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