Fork me on GitHub

Show Right Block & Center Block - Every Page  Bottom

  • I have downloaded, and am using, Nucleus-XL. Things seemed to be progress very well until I noticed that the added blocks appear just fine on the initial home page but the right side, bottom and center blocks are gone on any page but the HOME page.

    What do I have to do to make the blocks show up on all pages?

    Thank you for your help.

    Joe Dunn
  • hereis your answer
  • "
    --------------------------------------------------------------------------------
    Hey, I got it!!!!
    It's easy for every Module to display right blocks.

    simply edit the theme.php in the theme-folder.

    At the function themefooter, simply change the Line:


    Code:
    if( $index == 1 ) {


    into

    Code:
    if( $index == 1 || pnModGetName() == "htmlpages" ) {


    That ist working with every Modul, also more in one line. For e.g. like this:
    Code:

    if ($index == 1 || pnModGetName() == "htmlpages" ||
    pnModGetName() == "PostCalendar") {

    "

    So doi I have to list ever module by name or does the line:

    if( $index == 1 || pnModGetName() == "htmlpages" ) {

    Take care of every module current and future?

    Also I noticed a question about banners being truncated. Is there an answer to this?

    I did not understand the second part of the answer:

    "That ist working with every Modul, also more in one line. For e.g. like this:
    Code:

    if ($index == 1 || pnModGetName() == "htmlpages" ||
    pnModGetName() == "PostCalendar") {"

    What is the writer trying to say here?

    Thanky you for your help!

    Joe Dunn
  • the second part means you can use the one bit of script to allow as many modules as you want. So you dont have to repeat it for each module.
  • If I replace:

    if( $index == 1 ) {


    to

    if ($index == 1 || pnModGetName() == "htmlpages" ||
    pnModGetName() == "PostCalendar") {

    It will then work for every module? Sorry for being so dense but I am trying to understand.

    Joe Dunn
  • it will work for the modules you name (correctly that is)

    so in the example above center and right blocks will be shown for PostCalendar and htmlpages

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • So there is no way to use a wildcard such as *.*, going back to the DOS days.

    I would need to list each of the 20, 30 or 40 modules that might be deployed on my site and each time I add a new module I would have to update this list?

    Joe
  • Just remove the if( $index == 1 ) or if (whatever)... and the blocks will be displayed for every page.

    -Shawn

    --
    Get the Revolutionary AutoTheme HTML Theme System! Currently for Zikula, PHP-Nuke, CRE Loaded, osCommerce and Wordpress!
  • Ok, that works great! Now how about the opposite? Can I prevent some or all blocks from showing up in only certain modules?
  • Code

    //Example 1 (shows right blocks EXCEPT in Downloads or Web_Links):
    $mod = pnModGetName();
    if ($mod != "Downloads" && $mod != "Web_Links") {
        blocks("right");
    }

    //Example 2 (shows right blocks ONLY in Downloads or Web_Links):
    $mod = pnModGetName();
    if ($mod == "Downloads" || $mod == "Web_Links") {
        blocks("right");
    }


    So just pick which is easier. Either you list which modules DO display certain blocks, or you list which modules DO NOT display certain blocks.

    There are other ways to do it, like:

    Code

    //somewhere at top of theme.php
    $GLOBALS['CurrentMod'] = pnModGetName();

    $GLOBALS['ModList'] = array(
        "Downloads",
        "Web_Links"
    );

    //use in themeheader() where center blocks are
    if (in_array($GLOBALS['CurrentMod'], $GLOBALS['ModList'])) {
        blocks("center");
    }

    //use in themefooter() where right blocks are
    if (in_array($GLOBALS['CurrentMod'], $GLOBALS['ModList'])) {
        blocks("right");
    }


    HTH
    -Shawn

    --
    Get the Revolutionary AutoTheme HTML Theme System! Currently for Zikula, PHP-Nuke, CRE Loaded, osCommerce and Wordpress!

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