On Fri, Feb 27, 2009 at 7:26 AM, Hans <[email protected]> wrote:
>
> Re: disabling zones
>
>> There is however a little feature you might be able to take advantage
>> of. If you set urlzones: true in site.config you can turn off specific
>> zones by adding to a url something like header=false or side=false.
>> Anyway, this could perhaps be used in a config file (skin.php) by
>> doing something like:
>>
>> if (your cond) $_GET['header'] = false;
>
> I could not get this to work. It also seesm a bit of a cludge to
> manipulate a $_GET var directly.
Granted it's a bit unconventional to use $_GET, but I tend to be that
way... To get it to work there are two things:
1) urlzones: true in site.config
2) it must be equal to 'false' not false. My oversight.
The bigger problem is you have to have URLzones turned on which means
anyone could do that just via their browser, which we may not want.
For example, I often put things like: [if some conde]<(forward
error.page)>[if] in a header. With urlzones this could be bypassed, by
simply putting header=false in the url.
>> noPrintZones: side,bottom,header
>>
>> Or for another example, using the new site.config array syntax we might do:
>>
>> nozone:header: test*,main,site*
>> nozone:footer: test*,main
>
> Both seem to be good solutions. Bear in mind that nozone should
> prevent the zone being outputted to HTML, not just visually hidden.
These turned out to be easier to implement than I expected, thanks to
a BOLTpageCheck function I use for plugins, but had forgotten about...
If you insert these new lines between the first and last quoted below
in BOLTgetzones (~970, engine.php) you can tinker...
$BOLTcodePages = BOLTconfig('BOLTcodePages', 'code');
if (BOLTconfig("BOLTnozone:$zone") !== '') {
if (BOLTpageCheck(BOLTconfig("BOLTnozone:$zone"))) return;
}
if ($_GET['action'] == 'print') {
if (BOLTconfig("BOLTnoprintzone:$zone") !== '') {
if (BOLTpageCheck(BOLTconfig("BOLTnoprintzone:$zone")))
return;
}
}
if ($zone == 'header' || $zone == 'footer') {
Basically you set your config like this:
noZone:side: test*,main,site.languages*
noPrintZone:top: *
noPrintZone:bottom: *
What do you think? This of course allows you to turn on and off zones
via function or config file or whatever. And you do not use $_GET!
This should show up in the next release...
> To hide a zone or object via css one could use something this function:
>
> function BOLTFhide($args, $zone) {
> global $BOLTpluginStyles;
> if ($args[''][0]) $zone = $args[''][0];
> $BOLTpluginStyles[] = "#{$zone} {display:none;} #{$zone}bar
> {display:none;}";
> }
>
> I am using $BOLTpluginStyles here for brevity.
>
> [(hide)] will hide a zone with this markup in place (useful for right
> or side pages somewhere in the page hierarchy).
> [(hide topsearch)] as markup somewhere will hide an object with
> id=topsearch, in my case a div in th etop with the search box.
Would you mind posting this as a solution. I'm going to disable the
urlzones option in BoltWire, in favor of the noZone and noPrintZone.
Perhaps in the CSS tricks section.
Cheers,
Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---