List Info

Thread: Adding custom keywords to category pages.




Adding custom keywords to category pages.
user name
2006-09-20 22:51:30
Thanks. However I still can't seem to figure out how to
pass the
category to the keyword template.
 Hope I'm not asking to much...

Thanks

On 9/20/06, David E. Wheeler <davidkineticode.com> wrote:
> On Sep 19, 2006, at 19:15, Chauncey Thorn wrote:
>
> > Has anyone done this? Will the above work?
>
> No, Perl does not have a switch statement. But
if/elsif/else should
> work:
>
>    if ($value eq '/category1/') {
>        my keywords = 'keyword1,keyword2,etc';
>    } elsif ($value eq '/category2/') {
>        my keywords = 'keyword1,keyword2,etc';
>    } else {
>        # ...
>    }
>
> If you want something switch-like, try using the
trinary operator:
>
>    my keywords = $value eq '/category1/' ? qw(foo bar)
>                 : $value eq '/category2/' ? qw(baz
boo)
>                 :                          
$m->comp(...);
>
> Best,
>
> David
>
Adding custom keywords to category pages.
user name
2006-09-20 23:17:11
On Sep 20, 2006, at 15:51, Chauncey Thorn wrote:

> Thanks. However I still can't seem to figure out how
to pass the
> category to the keyword template.
> Hope I'm not asking to much...

Add this to %args:

$category

Then pass it in like this

<& '/util/keyword_list.mc', category =>
$burner->get_cat->get_uri &>

HTH,

David
Adding custom keywords to category pages.
user name
2006-09-21 04:49:35
Thanks.

On 9/20/06, David E. Wheeler <davidkineticode.com> wrote:
> On Sep 20, 2006, at 15:51, Chauncey Thorn wrote:
>
> > Thanks. However I still can't seem to figure out
how to pass the
> > category to the keyword template.
> > Hope I'm not asking to much...
>
> Add this to %args:
>
> $category
>
> Then pass it in like this
>
> <& '/util/keyword_list.mc', category =>
$burner->get_cat->get_uri &>
>
> HTH,
>
> David
>
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )