Custom Article Sorting Menu Item

Author Message

Daniel Ferenc

Saturday 03 January 2009 9:12:21 am

Hi *!

I'm working on a recipe based site where I created a new content type (recipe) that is very similar to article but has some additional fields (food type, etc). I would like to sort the recipes by these properties by having a menu where a user can click ("chicken" for example) and the system lists all recipes containing the "chicken" property.

Can anyone point me to a good place in the documentation or provide some basic information on where to look and start working on this? I'm an experienced PHP coder but this is my first (but not last!) encounter with ez Publish and the whole code structure is very very new to me!

Thanks in advance,
V00D00

André R.

Saturday 03 January 2009 2:50:29 pm

Hi!

We setup a similar site a year a go, dinmat.no.
'Type', as in dinner/meat/chicken, is setup as placement*, to spread the recipes over several folders to make sure performance is not decreased as several thousands recipes are added over time.
And so that the site can use multiple node placement for recipes that goes into several category's.
For time use, as in 'made in 20 minutes', 'enhanced selection' extension is used(lets you rearrange selections later on). And for dinner Theme, like Christmas or single food, object relationlist is used with custom extended attribute filter(objectrealtionfilter extension) witch allows multiple selection.

* A subtree for the recipes is setup with a custom folder class called 'recipe folder' with a template that does a content tree fetch from the node your on and down. The input variables for the other filter types (time, theme, offset and a couple of others not is use currently) use view parameter (like '/(time)/ten'). And to keep template code as low as possible, all the fetch code with filtering is done by a template operator. And the code to determine what menus that are selected is done by another(only needed for object relations though, as they are multiple selction).

Example:
http://dinmat.no/Finn-oppskrifter/Oppskrifter/Middag/Kj%C3%B8tt/(tid)/ti/(tema)/178/177
As in (the numbers are for the object relations):
domain/find-recipes/recipes/dinner/meat/(time)/ten/(theme)/178/177

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 19 2025 00:07:44
Script start
Timing: Jan 19 2025 00:07:44
Module start 'layout'
Timing: Jan 19 2025 00:07:44
Module start 'content'
Timing: Jan 19 2025 00:07:45
Module end 'content'
Timing: Jan 19 2025 00:07:45
Script end

Main resources:

Total runtime0.8885 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 587.9219152.6250
Module start 'layout' 0.00480.0029 740.546939.4453
Module start 'content' 0.00770.8795 779.9922529.5156
Module end 'content' 0.88720.0013 1,309.507812.1563
Script end 0.8885  1,321.6641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3507160.0002
Check MTime0.00130.1416160.0001
Mysql Total
Database connection0.00080.086010.0008
Mysqli_queries0.838194.3245540.0155
Looping result0.00060.0673520.0000
Template Total0.825592.920.4127
Template load0.00270.307220.0014
Template processing0.822792.599720.4114
Template load and register function0.00020.026910.0002
states
state_id_array0.00320.365210.0032
state_identifier_array0.00130.145820.0006
Override
Cache load0.00230.2535200.0001
Sytem overhead
Fetch class attribute can translate value0.00080.091320.0004
Fetch class attribute name0.00110.121830.0004
XML
Image XML parsing0.00070.073320.0003
class_abstraction
Instantiating content class attribute0.00000.000930.0000
General
dbfile0.00470.5329170.0003
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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs