HTML Module - Need to disable sidebar AddToCart from Static HTML pages?
Dozza
Joined: 2007-08-28
Posts: 112 |
Posted: Tue, 2011-03-15 15:00 |
I set this matrix G2 site up few years ago and recently added a few static HTML pages. After getting my head around G2 again, I've installed/implemented the HTML module (http://codex.gallery2.org/Gallery2:Modules:html), including the URL ReWrite, which has allowed me to create 3 static html pages as follows (all available from the custom top horizontal navbar) In a nutshell, I want to remove the 'checkout/Add to Cart' block from the sidebar (and ideally have no sidebar at all on the static html pages). To get to the stage I am at, I've installed/activated html module, activated the URL ReWrites for HTML module. I then added the HTML block to the 'clients' album page. This added and made visible the three links to 'MyPage1....etc. at the bottom of the album page, which has allowed me to make a note of their URLs. However, I didn't want the links at the bottom of album pages, so i've edited a local copy of modules/html/templates/blocks/local/HtmlBlock.tpl and commented out everything so these 3 links do not appear at all. I've then updated the top horizontal nav (which is in /themes/matrix/templates/local/theme.tpl) to include directlinks to the 3 static html pages mentioned above. So far so good. But I'd really like to remove the sidebar block displaying the 'cart' feature as it is irrelevant on these 3 pages (but needs to be there for all the client albums, which the end users can order from). But I can't work out how to disable a sidebar block from a static html page! In Admin>Themes, the 'shopping cart info' block is set to show in the sidebar as the default setting for Matrix theme, which it needs to be for some albums. I'm aware that I can override this at the album level, but which album are the 'static html module' pages within??? Really appreciate some help here. G2 System Info |
|
Posts: 8339
a little css can do the trick:
in your staticpages
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 4342
They're not.
I think for matrix the html pages are rendered using the module.tpl template (inside the theme.tpl) from the matrix folder.
You can verify this by putting some new text in a copy of the module.tpl file (save it as themes/matrix/templates/local/module.tpl) and see if it shows up.
You'll see where the sidebar is included - it says
{g->theme include="sidebar.tpl"}
That being the case, to stop the sidebar appearing in the page, condition that line depending on which module you're in. Something like this might work (perhaps someone else can suggest a more elegant way of doing it?)
Give it a whizz.
Posts: 112
HALLELUJAH!
Alec, you are the master - thanks ever so much as that nailed it first time. One happy dev, one happier client!
Posts: 112
@suprsidr – Thanks for that suggestion, but I've gone for alec's template tweak (above) rather than targetting the issue with css.
Posts: 4342
Master of a dying art, apparently. I shall miss G2.