fetch keywords

Author Message

Børge Warvik

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?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:01:43
Script start
Timing: Jan 18 2025 11:01:43
Module start 'layout'
Timing: Jan 18 2025 11:01:43
Module start 'content'
Timing: Jan 18 2025 11:01:43
Module end 'content'
Timing: Jan 18 2025 11:01:43
Script end

Main resources:

Total runtime0.7316 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.9063152.6094
Module start 'layout' 0.00530.0028 741.515639.4297
Module start 'content' 0.00810.7222 780.9453442.4531
Module end 'content' 0.73030.0013 1,223.39848.1953
Script end 0.7316  1,231.5938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4250160.0002
Check MTime0.00120.1678160.0001
Mysql Total
Database connection0.00080.103310.0008
Mysqli_queries0.691994.5694460.0150
Looping result0.00040.0557440.0000
Template Total0.705496.420.3527
Template load0.00200.277220.0010
Template processing0.703396.131120.3517
Template load and register function0.00010.012710.0001
states
state_id_array0.00090.121910.0009
state_identifier_array0.00110.153720.0006
Override
Cache load0.00160.2142150.0001
Sytem overhead
Fetch class attribute can translate value0.00080.105110.0008
Fetch class attribute name0.00050.073020.0003
XML
Image XML parsing0.00040.051410.0004
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00110.1499160.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs