[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] form in area tag, good except
>
> $Scratch->{page_arg} = $Tag->var('MV_PAGE', 1);
>
> --
> Mike Heins
Thanks Mike, this works wonderfully.
To have an "object", like in my case an [include] of different style search
engines that persist and are switchable even on flypage, you do the
following...
NOTE: WRT searchset and smode, these are unique to my implementation, you
may need to change accordingly.
1. One line global usertag foo.tag:
UserTag flycode Routine sub { return $Vend::Flypart }
2. Put this [set] and [calc] on every page you need it on.
It should work in the template, in a page, and in my
case an [include] in the top template.
# sets the mv_click action
[set searchset]
[seti smode][cgi smode][/seti]
[/set]
# this will insure the flypage item gets translated into the mix
[calc]
$Scratch->{page_arg} = $Tag->flycode();
unless ($Scratch->{page_arg}) {
$Scratch->{page_arg} = $Tag->var('MV_PAGE', 1);
}
return;
[/calc]
3. The buttons that controls this "switching":
<A HREF="[area
href="[scratch page_arg]"
form="
mv_click=searchset
mv_action=return
smode= # take note smode
"
]">switch to simle mode</a>
<A HREF="[area
href="[scratch page_arg]"
form="
mv_click=searchset
mv_action=return
smode=adv # take note smode
"
]">switch to advanced mode</a>
4. Then, obviously these controls need to control something. In my case
I have in my top template;
[if scratch smode eq adv]
[include templates/components/imode2.txt]
[else]
[include templates/components/imode1.txt]
[/else]
[/if]
NOTE: (optional)
With an addition of other scratch criteria, you can really get fancy.
I have an advanced mode, as well as a simple mode, for each: images,
audio and video. "smode" (simple or advanced) persists across all pages
until changed. The "type" of engine (image,audio,video) is controlled
by a scratch in the meta head, which by the way is a very cool way to
control appearance. In your template, where it says Page settings add:
searchtype:
description: search type change to
options:
note: where searchtype is foo. Now nest your [if] statements
accordingly.
----------------------
These can also be included in account.html or similar to have registered
user "settings" that will activate upon login.
The large part of this function was contributed by Mike Heins.
Paul