[Map Module] How do I get rid of the defult theme image block?

tlmothy

Joined: 2005-11-10
Posts: 41
Posted: Thu, 2006-04-06 08:18

How do I get rid of the defult theme image block?
The image blocks take up a lot of space and I would like to disable them just for the Google Map page.
Example
http://www.lumiere.net/~clock/cgi-bin/gallerymania/main.php?g2_view=map.ShowMap

So I want to keep these blocks on all the other gallery content, only taking them out of the google map section.
Thanks in advance!

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2006-04-06 14:05

If you have anything in the sidebar, whether it's showing up or not, the side bar will be there by the map.

In order to hide the blocks you would have to add some code in each block:

1- In the block template look for the callback function that is called
2- In the callback include file, search for that function in the "switch" statement then add this:

if (GalleryUtilities::getRequestVariables('view') != "map.ShowMap"){
}

To prevent the callback from executing when on the Map. This will in essence zero out the variable needed for the block template to show anything. Once that done, you can also add a statement in the block (if doesn't exists)

{if (empty(callbackvariable))}
{/if}

Around the all template and it will not show the block unless there is something to show -> this prevent errors.

Note that I have been as general as possible because you probably have several block on the sidebar and I didn't want to specifically help out removing one. This is the general idea on how it's done.

Now that this is said, just the fact that the blocks are in the sidebar (visible or not is irrelevant) the sidebar will show and it will just be empty.

If you truely want to remove the sidebar completely for the Map page, you will have to alter your theme with the same things:

theme.inc is where you grab the "view" variable and theme.tpl, you put a condition on showing the sidebar or not.

Let me know if it works for you !
See you

-------------------------
The Termite :-)

 
tlmothy

Joined: 2005-11-10
Posts: 41
Posted: Fri, 2006-04-07 03:33

Thank you for the help Termiten'

So basicly you are saying it is not a module problem per se but a theme problem, correct?
I have created and customized a few gallery1.x themes, unfortunalty I have yet to look into detail on how things work in Gallery 2.1.

It seems like a more complex problem than I had thought.

So If I include your code onto the block template to disable the blocks from being show via the map page, will the width of the the side menu take less space if the blocks are gone?

If that is the case then I don't mind having an empty side menu dispayed on the map page. As long as it doesn't take precious space away from my map.

I would like to make things clear before I attempt to edit things.

Thanks again.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-04-07 15:09
tlmothy wrote:
So If I include your code onto the block template to disable the blocks from being show via the map page, will the width of the the side menu take less space if the blocks are gone?

Nope that's unfortunate but it won't :-). I guess your best bet would be to modify the theme.inc and the theme.tpl to get the sidebar to diseapera alltogethere when the map is displayed :-)

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-04-07 16:35

Here is a seriously -crude- (and maybe even rude :-)) hack.

Find in map/templates/ShowMap.tpl:

        document.write('<div id="map" class="themap" style="width: '+myWidth+'px; height:'+myHeight+'px; color:black;background-color:lightgrey;border:1px solid black;">');

and change it to:

        document.write('<div id="map" style="position:absolute;top:0;left:0;width:100%; height:100%; color:black;background-color:lightgrey;border:1px solid black;">');
 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-04-07 18:17

You also need to add a higher z-index (i.e. z0index:100) if you want it to be on the top all the time :-)

It's a dirty yet efficient hack :-)

-------------------------
The Termite :-)

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-04-07 18:49
 
tlmothy

Joined: 2005-11-10
Posts: 41
Posted: Sat, 2006-04-08 01:04

Great thanks for all the replies I will give it a shot!

 
tlmothy

Joined: 2005-11-10
Posts: 41
Posted: Sat, 2006-04-08 01:14

Unfortunatly the map displays over everything. Even the legend and album images.

 
tlmothy

Joined: 2005-11-10
Posts: 41
Posted: Sat, 2006-04-08 01:38

Hmm... I will try to look into it and see what kind of ideas I can come up with to fix this.