eZ Community » Forums » General » Intelligent Node Duplication or Saved...
expandshrink

Intelligent Node Duplication or Saved Search?

Intelligent Node Duplication or Saved Search?

Wednesday 11 June 2008 12:05:11 am - 4 replies

Hi there helpful folks of the eZ community!

In our current and soon to be past CMS, there is actually a very useful feature called "Smart Folders" (Now "Collections"blunk.gif Emoticon which I'd like to be able to achieve in eZ Publish 4.0 if possible.

A "Smart Folder" is basically a "Saved Search" encapsulated as a single content-object and created from within the admin interface of the CMS:

1). Create a "Smart Folder" object in a specific location, say "/News/Tech"
2). Add some search criteria to it:
2a). Get all "Article" objects,
2b). Located in "/Products" and "/Solutions",
2c). With a title that contains the string "technology"
3). Save.

When viewing the Smart Folder in this case, it would act just like a folder of Article-objects for example, except each Article might be physically located in "/Products" or "/Solutions" and had a title with "technology...whatever" in it.

This basically means that you needn't put all your "news" Article content in one place, it could be located anywhere. Only using a Smart Folder they would appear as though they had become collated in one place, similar to eZ's node duplication but with some "intelligence"

Does this type of content-object exist natively in eZ or is it something that's perhaps an extension or even able to be built from scratch within the eZ Components framework? If so, is anyone able to point me in the right direction?

Many thanks for reading happy.gif Emoticon

Modified on Tuesday 17 June 2008 3:23:46 am by Russell Michell

Wednesday 18 June 2008 8:57:28 am

Hi Russ,

you can create a class with the attributes:

Title (textline)
Contentclasses (multiselect)
Locations (objectrelationlist)

Add the classes and the class_id you whant to be selectable to the multiselect.

When you create objects of this class, you will provide which classes to include, where to fetch nodes from and the title of this object.

Then, in your template, you create a fetch that fetches nodes of the specified class(es) at the specified locations.

The you should have your Einstein-folders happy.gif Emoticon

Felix

Monday 23 June 2008 1:34:31 am

Hi Felix and thanks for your input.

I got as far as creating the new content class you described. However the "objectrelationlist" datataype wasn't obvious from the "add attribute" drop-down list. I had to look in the HTML source to see that "Object Relations" (plural) in the list, was actually the "objectrelationlist" datatype - perhaps it needs to be re-labelled in that drop-down menu.

You described the process pretty well but I actually got stuck at "Then, in your template, you create a fetch that fetches nodes of the specified class(es) at the specified locations."

Which template is this? What's a "Fetch"? Do I need to create a new "blah.tpl" template and hand-code some template logic each time a new "Einstein Folder" blunk.gif Emoticon is created?

The idea behind the Smart Folder was so that once a Smart Folder content-type was created by an admin, it was just as easy for any eZ user to create a "Folder" or an "Article" content-type, as it was to create a "Smart Folder" content-type and configure it to "collect" articles, folders etc from different parts of the folder hierarchy as I described. Once published, and viewed, the Smart Folder would display all the collected content as a simple list (<ul>, <dl> or whatever).

Thanks a lot for your time so far Felix. My apologies if I have missed something or for just being new to eZ! happy.gif Emoticon

Russ

Modified on Monday 23 June 2008 1:45:27 am by Russell Michell

Monday 23 June 2008 10:50:48 am

>Which template is this? What's a "Fetch"? Do I need to create a new "blah.tpl" template and >hand-code some template logic each time a new "Einstein Folder" blunk.gif Emoticon is created?

You need to take a look at some documentation for some of the basic concepts in ezp:
http://ez.no/ezpublish/documentat...ding_an_ez_publish_site/prerequisits

The thing he is talking about is custom template code to handle the search based on what been inserted into into the smart folder object. aka the content/view/full template aka override/templates/full/smart_folder.tpl. you also need a override so the template is used, but that is explained in the above doc page.

I have actually created a thing like this for a customer, we called it virtual folders, but its's the same concept. Beside the stuff mentioned above I also created a custom edit template so some ajax and custom drop downs where used for class / class attribute filtering (for the search).

search:
http://ez.no/doc/ez_publish/techn...dules/content/fetch_functions/search

Node fetch:
http://ez.no/doc/ez_publish/techn...modules/content/fetch_functions/list
http://ez.no/doc/ez_publish/techn...modules/content/fetch_functions/tree

Friday 27 June 2008 6:16:43 am

Excellent!

Thank-you Andre happy.gif Emoticon

After a day or two following that tutorial and a day creating template code for my Smart Folder, it works just as I intended.

I really appreciate your help..

Cheers!
Russ

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu