Can the keywords attribute be used to relate objects of different classes?

Author Message

Barney Gumble

Tuesday 27 January 2004 10:42:48 am

In 3.3.2 I'm using the standard method to find related objects, i.e.

{let related=$node.object.data_map.keywords.content.related_objects}
{section show=$related}
{section loop=$related}

This is working fine, however only objects of the same class are showing up. Is there any way that the above can be refined to show objects of a different class? This is required as I need to relate an event object to an article object for example.

Any help offered will be greatly appreciated as always!

Barney Gumble

Tuesday 27 January 2004 10:53:42 am

Looks like I might have just answered my own question, using the related objects from within the admin tool and this...

{section loop=$node.object.related_contentobject_array}

Still, any further pointers welcome.

Paul Borgermans

Tuesday 27 January 2004 11:22:04 am

Not with the current keyword datatype. There are new fetch functions for keywords (3.3-2) which you could use and where you can omit a class to fetch all objects of all classes sharing a specific keyword (or even the first x letters).

It's used in the pdf template functions and I used it to build a keyword index where each keyword is listed with all objects. It is obviously more powerful than $node.object.data_map.keywords.content.related_objects

syntax like

{let kwlist=fetch(content,keyword, hash('alphabet',<part or whole keyword>,  {*required*}
                            'classid',<class id>, {*optional, integer*}
                             'offset',<offset>, {*optional, integer*}
                             'limit',<limit> {*optional, integer*}
                           )}  

It returns a weird array with if you loop over it: $kwlist:item.keyword is available only once (facilitating output formatting) and $kwlist:item.link_object has the structure for displaying/linking

Do an {$kwlist:item|attribute(show,2)} and see for yourself. A more extended example will be in "the book".

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Barney Gumble

Tuesday 27 January 2004 11:45:25 am

Thanks Paul that's great. What's the latest news on the book? I need some new bedtime reading...

Bengt Skogly

Tuesday 27 January 2004 12:01:19 pm

What is "the book"?

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 31 2025 04:23:35
Script start
Timing: Jan 31 2025 04:23:35
Module start 'layout'
Timing: Jan 31 2025 04:23:35
Module start 'content'
Timing: Jan 31 2025 04:23:37
Module end 'content'
Timing: Jan 31 2025 04:23:37
Script end

Main resources:

Total runtime1.3597 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 588.6250151.2734
Module start 'layout' 0.00770.0035 739.898436.7266
Module start 'content' 0.01131.3477 776.6250986.9063
Module end 'content' 1.35900.0007 1,763.531312.0625
Script end 1.3597  1,775.5938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2522160.0002
Check MTime0.00130.0989160.0001
Mysql Total
Database connection0.00170.123110.0017
Mysqli_queries1.282494.3157650.0197
Looping result0.00050.0386630.0000
Template Total1.312696.520.6563
Template load0.00250.183420.0012
Template processing1.310196.350720.6551
Template load and register function0.00130.096510.0013
states
state_id_array0.00730.537710.0073
state_identifier_array0.00180.132920.0009
Override
Cache load0.00200.1453260.0001
Sytem overhead
Fetch class attribute can translate value0.00070.049630.0002
Fetch class attribute name0.00200.148060.0003
XML
Image XML parsing0.00080.060130.0003
class_abstraction
Instantiating content class attribute0.00000.000860.0000
General
dbfile0.00100.0716170.0001
String conversion0.00000.000740.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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/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: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs