Can blocks be defined other than global
Permalink
Hi,
We have banners on our site which are global element.
I wanted to know if you can define a block to a specific branch of a website.
The site has 14 distinct areas. I want a particular ad block to show up in one area. Is this possible?
We have banners on our site which are global element.
I wanted to know if you can define a block to a specific branch of a website.
The site has 14 distinct areas. I want a particular ad block to show up in one area. Is this possible?
I have a site with 14 distinctive areas. I am wanting to have banner ads in each section to display with each of their own areas. The global blocks across the whole site. the sections to just inherit the section material.
I'm sorry, but your question is not very clear. I can see English is not your first language, that's ok, it isn't mine either...
but can you explain a bit more what you want ? Maybe we can help.
but can you explain a bit more what you want ? Maybe we can help.
You have item on a page which is different on every page these are local elements.
You have a site menu which is seen on all pages through out the site. This is a global element.
If you have sections in a website, or let say mini sites within a larger site you may wish to have elements specifically to those mini sites and not in the rest of the site. These would be referred to as section elements.
I am wanting to understand if blocks can be used in such a case.
I have a single site with 14 mini sites. Each mini site is subject specific. So can a block be setup like a global block that goes across a whole site. But in this case only work for a mini site?
You have a site menu which is seen on all pages through out the site. This is a global element.
If you have sections in a website, or let say mini sites within a larger site you may wish to have elements specifically to those mini sites and not in the rest of the site. These would be referred to as section elements.
I am wanting to understand if blocks can be used in such a case.
I have a single site with 14 mini sites. Each mini site is subject specific. So can a block be setup like a global block that goes across a whole site. But in this case only work for a mini site?
@marcdimmick
I believe this could be done using page attributes and maybe by checking the page path.
Here is an idea on how to use an attribute:
- each minisite has an attribute shared by it and all of its subpages (e.g. select attribute name of "minisite" with values "minisite1", "minisite2", "minisite3", etc.)
- in your header.php (or similar file), you check the value of the page attribute
- if the page attribute is true, then a new global area is created using the value of the minisite attribute as the area name
I have attached screenshots describing this.
WillemAnchor might have a better idea or see flaws in my approach.
I believe this could be done using page attributes and maybe by checking the page path.
Here is an idea on how to use an attribute:
- each minisite has an attribute shared by it and all of its subpages (e.g. select attribute name of "minisite" with values "minisite1", "minisite2", "minisite3", etc.)
- in your header.php (or similar file), you check the value of the page attribute
- if the page attribute is true, then a new global area is created using the value of the minisite attribute as the area name
$minisite = (string) $c->getAttribute('minisite'); if ($minisite) { $a = new GlobalArea("$minisite"); $a->display(); }
I have attached screenshots describing this.
WillemAnchor might have a better idea or see flaws in my approach.
Templates could work, but your solution is far more flexible :)
Thank you very much for your assistance.
:)
Regards
Marc
:)
Regards
Marc
If you add a block to a non-global area, it will only be displayed on the page it was added to.
Are you trying to restrict the block to only certain pages or just one page?