Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.



Fetches the number of nodes that use certain keywords.


fetch( 'content', 'keyword_count', hash( 'alphabet', alphabet,
                                       [ 'classid',  classid  ] ) )


alphabet string The sequence that should be matched. Yes.
classid integer Filtering: the ID number of the class. No.


The number of matching nodes (as an integer).


This function returns the number of nodes that encapsulate objects which make use of certain keywords. The keyword must be prodived using the "alphabet" parameter. This parameter can be a letter, a part of a word or an entire word - the function will look for keywords that start with the specified sequence. By default, the function will count nodes that encapsulate objects of all types. However, it is possible to only count objects of a certain type, this can be achieved by using the optional "classid" parameter. The function returns an integer.


Example 1

{def $count=fetch( 'content', 'keyword_count',
                   hash( 'alphabet', 'computer' ) )}
There are {$count} number of nodes using keywords starting with "computer".

Outputs the number of nodes that encapsulate objects which use keywords starting with "computer".

Balazs Halasy (06/02/2004 12:07 pm)

Balazs Halasy (29/04/2005 8:37 am)


There are no comments.