Path

ez projects / ezkeyword:_improved_fetchin...


ezkeyword: improved fetching of related objects

UNIX name Owner Status Version Compatible with
ezkeyword:_improved_fetching_of_related_objects Georg Franz planning 1.0 3.4x (almost certain 3.5 too)

Hi,
the current method eZKeyword::relatedObjects (datatype ezkeyword) in
kernel/classes/datatypes/ezkeyword/ezkeyword.php
has a "lack of features". This rewritten method can improve some things
...

Hi,
- attention: only for the 3.4 series!! -
the current method eZKeyword::relatedObjects (datatype ezkeyword) in
kernel/classes/datatypes/ezkeyword/ezkeyword.php
has a "lack of features". This rewritten code improves some things
...
Features:
-----------------------------------
-) Added a "read permission check".
-) Added a var to limit the results (e.g. very important if you have
many objects with the same keywords)
-) Added a "sorting" of the result possibility. The result can be
sorted by
frequency (rank words higher, if they have more keywords in common)
section id
object name
node depth
published
modified
Multiple options can be choosen.
-) Added a "prefer own section" parameter
Fetch first objects which are in the same section as the current object,
second
fetch object from other sections.
Installation:
--------------------------------------
Dirty, but quick way:
Replace the "function &relatedObjects" in
kernel/classes/datatypes/ezkeyword/ezkeyword.php with my code from
the attached txt-file.
Good, but very slow way:
Create an own "ezkeyword"-datatype in your extension dir. and take my code
out of the txt-file.
Add following settings to your site.ini.append (example):
[ContentSettings]
# max amount of results
keywordRelatedObjectLimit=20
# keyword order by:
section|published|modified|name|frequency|depth
keywordRelatedObjectSortOrder[]
keywordRelatedObjectSortOrder[]=frequency
keywordRelatedObjectSortOrder[]=depth
keywordRelatedObjectSortOrder[]=published
# selecting first the related objects of the current section
# true|false
keywordRelatedObjectPreferOwnSection=true
Kind regards,
Emil.
----------
Changelog:
2004-04-24
make work with 3.4alpha3
2004-04-27:
Improved query
New: If "prefer own section" is true
-) also sort the result by the main path
-) only one query is needed instead of two to get the results

Screenshot

No news yet.

This project has no reviews yet. Be the first one to review it!

No forum messages yet.