Forums / Setup & design / Problems starting

Problems starting

Author Message

Jesper Gloor

Thursday 13 May 2004 5:13:45 am

Hi everybody!
My problem is the following, I'am new to EZ and have prepared by doing the tutorial twice. Now I felt I'd better try starting my own, trying to follow the tutorial for the 3rd time.
I succeeded in doing the header and footer part for my own page, but then it stopped. For my starting page i want to ad some extra navigation on the left side, some kind of expandable category list to be able to navigate directly to some specific items. finaly I want to ad some of the latest products, or some kind of inteligent list of what my user needs according to his last transactions.
Since this first page isnt an article, I guess I have to define some kind of class which can do the above, and refer to this as the default content?
Second I guess that I have to create som folders and some subfolders for each category, but isnt there a simpler way? Many of my subs are the same and it wouldnt make sence just repeating them.

- Furniture
--- 1850-1900
----- designer
--------
--- 1900-1950
--- 1950-2000
--- Designer
--- etc
- Art
- Cars

I hope this illustrates what I mean. I know its a lot of questions, but I'm willing to read, so if someone has a clue where to find such info, or just has to much time, please help

:-) Jesper

Alex Jones

Thursday 13 May 2004 6:25:38 am

Hi Jesper! I will try to cover as many questions as possible here, but don't be afraid to ask about anything that doesn't make sense, :)

<b>Expandable Category List</b>
Check out the Treemenu operator, which was added to eZ publish a couple of versions ago. Note, this is a newer version than the Treemenu listed under the Contributions section, so it can be a bit confusing at first. This will provide you the ability to easily add extensive menus to your navigation.
Treemenu documentation: http://ez.no/ez_publish/documentation/reference/template_operators/miscellaneous/treemenu
Another thread where I posted some code: http://ez.no/community/forum/setup_design/navigation_menu_how_does_site_menu_look

If you just want a list of some products, you should be able to use a fetch to retrieve the items to display. You can tell eZ publish to pull only the last X items to display the newest products and utilizing attribute filters, you can ensure that you only display items that meet certain criteria. I haven't tried to tie the display of items to recent transactions, so someone else may need to provide more detail there.
Data Fetch: http://ez.no/ez_publish/documentation/development/libraries/ez_template/operators/data_fetch
Fetch Function Examples: http://ez.no/ez_publish/documentation/customization/tips_tricks/fetch_function_examples

<b>Categorization</b>
This can be accomplished in a couple of different ways. You could create your product and assign it to multiple <i>Locations</i>. Or, you can utilize the <i>Object Relation</i> functionality to create categories which you can assign to the product. Using <i>ORL</i>s will cut down on the amount of objects in the database and should prove a better choice in the long run, but the <i>Object Relation</i> system isn't documented as well as I would like. I haven't begun using this method yet, but plan to on my next major site. I do not know how this will effect the operation of the treemenu operator.

Hope this helps you move forward.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Willie Seabrook

Friday 14 May 2004 11:14:48 pm

Hi Jesper,

A crucial point in ensuring your site is able to grow gracefully with ezPublish is creating sensible content classes, and then categorising instances of those classes (content objects) in a nice folder structure.

Alex has made a good explanation and I'll expand on it by providing a practical example, based upon what I *think* your trying to do.

Here's two different ways you could do what your trying to do:

class furnature:

attributes:
period_begin (date)
period_end (date)
category (designer | contemporary | art | etc) (option)
picture (image)
description_text (xml_text)

and then publish all furnature objects under /root/furnature/

+'s:
Fast creation
Easy

-'s:
More complex fetch calls within your templates to display appropriate furnature to your users. You'll have to do attribute filters as opposed to simply calling all nodes below a parent with the next example:

class furnature: (no category)

attributes:
period_begin (date)
period_end (date)
picture (image)
description_text (xml_text)

Then you would do something like the following when you publish to make up for the lack of categorisation on the content object:

/root/furnature/designer (publish designer furnature here)
/root/furnature/art (publish arty furnature here)

+'s
Much easier fetch calls in your templates. Each folder to categorise furnature objects you use can simply display all nodes below it (this is a simple fetch call... a real 'one liner')

-'s
Its a bit more time consuming to publishing objects as if a peice of furnature belongs in multiple categories or time periods etc you'll have to select multiple publish locations.

I would suggest stongly (unless you describe what your trying to do in more detail that raises issues I was unaware of) that you use a folder structure. Its much simple, especially for a newbie.

Good luck and post any other questions!

Regards,
Willie

Alex Jones

Saturday 15 May 2004 6:29:47 am

Good detail Willie! That makes it much more sensible than my explanation. One key thing Jesper, as I think both of our responses to you points out: think towards the future. I cannot stress this enough. eZ publish is a framework, so everything you do now will be the foundation for your site going forward. While it is easier to work with the directory structure at first, it may well come back and make life more difficult in the long run if you have a large site with items that fit into multiple categories, which it appears that you do. I really wish I had known (and had the ability) to structure my site with categories instead of folders when I started with eZ publish a year ago.In the long run I will probably have to redo a large amount of work to account for my shift in understanding. While the use of related object lists requires that you write complex fetches, it will save you time in the long run. Adding multiple Locations to every single item takes time which would be better spent elsewhere in my opinion.

So, I think a lot of this boils down to:
1. How many products will you have on the site, both initially and a yaear or three from now?
2. How quickly do you need this site to go live?
3. How comfortable are you with a steep learning curve on the development-side of the project?

As you can see, a lot of us are still trying to define the approaches we think are best. Ultimately these will vary as eZ publish is very powerful and very flexible.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Jesper Gloor

Sunday 16 May 2004 8:35:59 am

Thanks to both of you! I guess i can use some of your information, though i got quite confused about the two methods, folder and category. Well here is some extra information, so you might be able to tell me wich method might be the best.

As part of a school project, me and my project group are supposed to make a frame for an Antique webshop, which in the the nearest future will be given over to the owner of the shop, and from where we will not have anything to do with it anymore. This shop owner has to have the posibility to add products without knowing very much of what EZ is, but as the products are Antiques, there is often only one Item, and when this item is sold, it will have to be deleted. Looking at the common enduser of an antiqueshop, aged 50+, we want to add a very simple navigation to the page, meaning that, if someone has a special wish, he should be able to find the item, on what he knows about it, and this is where we want to make use of the categories. The user should be able to find a specific item based on, the artist, artgenre, year, periode in time etc. What the best solution might be I don't know and that was why I asked the above question in the first place. In the meantime I have been reading almost all the documentation, but to be honest, this is even confusing me more. I will try to look at both of your examples, and maybe during the implementation we will get wiser.

Jesper Gloor