Thursday 02 February 2006 2:30:14 am
I've extended the content class "article" with a keywords attribute of type Keywords. This lets me tag articles whit a string where every keyword is separated by a comma. I'm having problems using this functionality in a fetch. When viewing an article that has keywords I want to make a list of all the other articles that has a keyword that matches one of the keywords for the current article. If I have an article with the keywords "football", "manchester united" and "liverpool". I get the fetch to work when I'm doing this, matching only a single keyword:
{def $articles=fetch('content', 'keyword', hash('alphabet', 'football'))}
The article node gives me the articles keywords in two ways, I can get the whole string, or an array of keywords. So if I wan't to fetch with multiple keywords, for me I should be able to something like this: comma separated string:
{def $articles=fetch('content', 'keyword', hash('alphabet', 'football, manchester united, liverpool'))}
using array:
{def $articles=fetch('content', 'keyword', hash('alphabet', array('football', 'manchester united', 'liverpool')))}
The last two examples doesn't work. How is this done?
|