HTML Module - Need to disable sidebar AddToCart from Static HTML pages?

Dozza
Dozza's picture

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)
http://www.milliepilkington.co.uk/About
http://www.milliepilkington.co.uk/Testimonials
http://www.milliepilkington.co.uk/Links

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
Gallery version = 2.2.3 core 1.2.0.5
PHP version = 5.2.6 cgi
Webserver = Apache/1.3.34 Ben-SSL/1.55
Database = mysqlt 5.0.51a-log, lock.system=database
Toolkits = ArchiveUpload, Exif, Getid3, LinkItemToolkit, NetPBM, Thumbnail, Gd, jpegtran, SquareThumb
Acceleration = none, none
Operating system = Linux infong 2.4 #1 SMP Tue Dec 18 22:34:10 UTC 2007 i686 GNU/Linux
Default theme = matrix
gettext = enabled
Locale = en_GB
Browser = Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1
Rows in GalleryAccessMap table = 553
Rows in GalleryAccessSubscriberMap table = 7557
Rows in GalleryUser table = 14
Rows in GalleryItem table = 7554
Rows in GalleryAlbumItem table = 56
Rows in GalleryCacheMap table = 0

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2011-03-15 16:38

a little css can do the trick:

#sidebar {
  display: none;
}

in your staticpages
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2011-03-15 20:51
Quote:
but which album are the 'static html module' pages within???

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?)

{if $theme.moduleL10Domain != 'modules_html'}
{g->theme include="sidebar.tpl"}
{/if}

Give it a whizz.

 
Dozza
Dozza's picture

Joined: 2007-08-28
Posts: 112
Posted: Thu, 2011-03-17 15:06

HALLELUJAH!

Alec, you are the master - thanks ever so much as that nailed it first time. One happy dev, one happier client!

 
Dozza
Dozza's picture

Joined: 2007-08-28
Posts: 112
Posted: Thu, 2011-03-17 15:11

@suprsidr – Thanks for that suggestion, but I've gone for alec's template tweak (above) rather than targetting the issue with css.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2011-03-17 15:49
Quote:
Alec, you are the master

Master of a dying art, apparently. I shall miss G2.