List Info

Thread: name/value pairs in keywords




name/value pairs in keywords
user name
2008-04-18 10:32:22
I've been using keywords associated with categories in order
to store
additional data about the categories that the native Bric
interface does
not allow me to do.  For example, for the events on our
site, I name the
categories with the singular version of the type of event
they
represent, e.g. "Film" for the /programs/film
category.

However, I've recently had a need to create some internal
reports and
found that I had a need to use the plural "Films and
Film Series" in
this report, but I didn't want to make a hard association
between the
category element and this label in my template.

So, I created a keyword scheme that lumps together
name/value pairs into
the keyword:

For example:

_plural_name:Film Programs and Events

is the keyword name.  Then, in my template, I iterate over
the keywords
for each category, looking to see if I find a match on
"_plural_name:"
and if I do, I grab the text after the ":".

Has anyone run into a similar need and taken a better
approach?

Thanks,

- Dave


-----Original Message-----
From: Simon Wilcox [mailto:simonwdigitalcraftsmen.net] 
Sent: Friday, April 18, 2008 11:22 AM
To: devellists.bricolage.cc
Subject: Lists of keywords

Hello all,

We use keywords as "tags" on one of our sites 
(http://www.quep
asacontent.co.uk/tags/) and now we're creating a
second,

similar, site within the same Bricolage instance.

We've found that there's no way to get all the keywords for
a given 
site, it always searches all keywords.

This is a bit sub-optimal and we'll try to fix it next week
when Paul's 
back in the office but in the meantime would it be
faster/more efficient

to pull all the keywords and search for any stories in the
current site 
that use that keyword or to pull all the active stories and
read the 
keywords from each one to create our own list ?

Actually, reading the above it seems that the latter would
be more 
efficient but if someone could confirm that and also that
we're not 
being particularly dense with respect to the searching by
site problem 
I'd be most grateful.

Simon.

-- 
Digital Craftsmen Ltd
Exmouth House, 3 Pine Street, bond. EC1R 0JH
t 020 7183 1410 f 020 7099 5140 m 07951 758698
w http://www.digitalcr
aftsmen.net/

Re: name/value pairs in keywords
user name
2008-04-18 11:09:41
On Apr 18, 2008, at 08:32, Beaudet, David P. wrote:

> However, I've recently had a need to create some
internal reports and
> found that I had a need to use the plural "Films
and Film Series" in
> this report, but I didn't want to make a hard
association between the
> category element and this label in my template.

Lingua::EN::Inflect works pretty well for this.

> So, I created a keyword scheme that lumps together
name/value pairs  
> into
> the keyword:
>
> For example:
>
> _plural_name:Film Programs and Events
>
> is the keyword name.  Then, in my template, I iterate
over the  
> keywords
> for each category, looking to see if I find a match on
"_plural_name:"
> and if I do, I grab the text after the ":".

Cute hack.

> Has anyone run into a similar need and taken a better
approach?

That's not a bad solution. An alternative might be to store
such data  
in the category description attribute and parse that. Then
you don't  
have to do as much work with your keywords (e.g., exclude
the pair  
keywords them from output). But if you use that field for
content,  
keywords are probably your best bet. Or the ad string
fields. You  
could use one of those, too. Or both.

Best,

David

[1-2]

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