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.
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- craigh responded to »Using PageUtil::addVar() to load script code« 03:29 PM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
How to restrict block to "Home"
-
- Rank: Softmore
- Registered: Dec 10, 2003
- Last visit: May 12, 2010
- Posts: 299
-
- Rank: Softmore
- Registered: Sep 13, 2010
- Posts: 105
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
-
- Rank: Softmore
- Registered: Dec 10, 2003
- Last visit: May 12, 2010
- Posts: 299
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 -
- Rank: Softmore
- Registered: Sep 13, 2010
- Posts: 105
I forgot to write that you need to deactivate this block in Blocks administration. It still will show with the code but only ones.
--
Carl Georg aka Mazdev
Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment
-
- Rank: Softmore
- Registered: Dec 10, 2003
- Last visit: May 12, 2010
- Posts: 299
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? -
- Rank: Softmore
- Registered: Sep 13, 2010
- Posts: 105
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
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
FYI, Zikula 1.3.x handles the "homepage" in the Advanced placement options
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Softmore
- Registered: Dec 10, 2003
- Last visit: May 12, 2010
- Posts: 299
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
- Moderated by:
- Support
