Jump to content

[SOLVED] remove a blok from sidebar on certain pages


Recommended Posts

Hi

 

On certain pages i have a left or right sidebar

 

in these sidebars are some blocks

 

how can i exclude certain blocks from some pages

 

example

 

the blog block appears in every left sidebar, but i only want to show it on blog pages, and in turn i do not want to show other items on blog pages

 

i know i can do something in 'positions' but when i want to do so, it also asks to hook it while that is already done

 

 

Link to comment
Share on other sites

Hi,

 

there are three ways of doing this

1) You can disable certain pages right in the backoffice through positions as you stated

2) You can use CSS to hide it on certain pages.

3) You can edit it right in the tpl files (Not recomended, although sometimes necessary if there is no easier way of doing it)

 

This is the CSS way.

You will need to look into the source code of your website and check the value of the ID in the BODY TAG. In <Body id="Something">, the value would be Something. Let me give you an example. You want to have 3 columns on every page. Except for homepage.

You open up your global.css file and write this (usually to the bottom of the page, however it does not really matter)

body#index #left_column, body#index #right_column {display:none}
body#index #center_column {width:100%}
Edited by PSfever.com (see edit history)
Link to comment
Share on other sites

Thanks Dioniz, that was what i was looking for

 

@psfever i know that it is possible to do with css, but it is not recommended to hide stuff... search engines don't like you doing that you know... so unless there is no other way i'd prefer not to use css to hide things

Link to comment
Share on other sites

@ Dioniz

 

Nope does not work

 

In positions i go to module in displayRightColumn and click edit

 

than i select cart, order

 

but it is still in that sidebar

 

in preferences i have force compile "on" and cache "no"

Link to comment
Share on other sites

That is odd, 

 

if you are against the CSS version, how about trying the drastic force of tpl conditioning?

You will need to edit out the right column by putting this IF statement around it. Try it out and let me know.

{if $page_name == 'index'}
<div id="right_column">.....</div>
{/if}
Link to comment
Share on other sites

Well i am not against it, i was saying that it is a solution if nothing else would work...

 

Changing the tpl is something i am not considering either because i would have to do that again on updates

 

I hope i can do it the way described above that would be a clean solution

 

But thanks anyway, i learned few things from your answer :-)

Edited by carplu (see edit history)
Link to comment
Share on other sites

You're welcome, it's just that I don't know of any other solution...I don't like the .tpl editing either, but if nothing else works, that seems to me the only way to do this. Well, there is one more way which I thought of right now, you can create an override php file that would not be changed during any updates. In this file you would disable the loading of left and right column. But this already seems way more complicated than it should be.

Link to comment
Share on other sites

you defined exception for these modules for quick order ?

 

i have enabled right sidebar for "order" page so when on 1 page checkout the right sidebar is visible

 

than i go to modules>positions

 

in displayRightColumns for Tags blok i select edit

 

on the next page is get this:

 

module : tags blok

hook in : displayRightColums (Right Column Block)

 

In exclude i select: cart, order

 

(i'm in dutch front end but this is in english so i selected both to be sure, but no result)

 

 

quick order is not in the list

Edited by carplu (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...