Fork me on GitHub

How to restrict block to "Home"  Bottom

  • I have an HTML block that I would like to restrict to my "Home" page. Is there a way to do this by using the "Show/hide advanced placement options"?

    I'm on Zikula 1.2.8

    Thanks for any help.



    Edited by MarcPare on Jan 07, 2012 - 03:33 AM.
  • I couldn't make it via Show/hide advance. I did it direct in the templates/master.htm or templates/modules/home.htm of my theme

    Example:

    Code

    <!--[blockposition name=right]--><!--[if $pagetype eq 'home']--><!--[pnblock bid="7"]--><!--[/if]-->


    You only need to look up your block id in the block administration.

    --
    Carl Georg aka Mazdev

    Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment

  • HI Carl

    Thanks for the code snippet, but it add two instances of my block to my home page and I can't seem to figure out how to add the line properly.

    I am wondering if it would not be easier to add a "Home" selection to the "Show/hide advanced placement options" section. This way it would be available for more possible uses with other modules.

    Marc
  • I forgot to write that you need to deactivate this block in Blocks administration. It still will show with the code but only ones. icon_rolleyes

    --
    Carl Georg aka Mazdev

    Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment

  • Sorry for the delay in response! Thanks. I tried it but I need to tweak it more. I'll work on it.

    I wonder if there was still a way to add a "Home" selection to the Block->"Show/hide advanced placement options" section. This way it would be available for more possible uses with other modules. (as I suggested earlier).

    Should I add this as a feature request for 1.3?
  • I thought ones of adding a "Home" selection to the Block -> "Show/Hide advance placement option, but I gave it up, to much involved doing it.

    The easiest way would be to create block position only for this block in your templates/modules/home.htm and assign the block to it.

    If you don't have a home.htm and everything is managed via the master.htm, you only add this in your master.htm:

    Code

    <!--[blockposition name=right , left or center]--> -----> above or below this snippet (depends which block you want to have first:

    <!--[if $pagetype eq 'home']--><!--[blockposition name=Your block position]--><!--[/if]-->



    Another possibility is to use the module content as your homepage, use a home.htm 98% width with only one column and take on of the content page layouts 2 or 3 columns. As content type you can select then the blocks you want. If you don't want then this blocks to appear on other module pages, only deactivate them in Blocks admin



    Edited by mazdev on Jan 22, 2012 - 06:48 PM.

    --
    Carl Georg aka Mazdev

    Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment

  • FYI, Zikula 1.3.x handles the "homepage" in the Advanced placement options icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Thanks Mateo, nice to hear that the option is there in the new version. I have still quite a few sites to migrate to 1.3.1 but it will come in handy once I migrate my larger site that will make use of this option.

    Cheers,

    Marc

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