Share » Forums » Setup & design » Object relation Question?

Object relation Question?

Object relation Question?

Monday 05 September 2005 12:19:06 am - 6 replies

Modified on Monday 05 September 2005 12:20:03 am by Nathan Kelly

Author Message

Xavier Dutoit

Monday 05 September 2005 2:24:51 am

Hi,

Makes sense to me, as I do it mostly like you.

I'd suggest to put the static content as the body of the node 2, as by experience static texts aren't that static, nor to mention a few added values, like being able to find it from the search engine.

As for the "how to retrieve the promo, I usualy fetch the children of the media/promotions node (fixed id) by reverse publication date, with a limit of 1. This obviously takes the latest one.

I don't understand the problem of the size of the static text, as it seems to be specific to you layout. I put these elements into a float or fixed position near the top, or within a side column and that does the trick.

X+

http://www.sydesy.com

Nathan Kelly

Monday 05 September 2005 5:04:32 pm

<i>I don't understand the problem of the size of the static text, as it seems to be specific to you layout. I put these elements into a float or fixed position near the top, or within a side column and that does the trick.</i>

I'll try to illustrate the layout as best I can, this may give you a better idea of how the page elements interact...

|----------Home page layout template-----------|
|                                              |
|----------Navigation--------------------------|
|                                              |
| |--------Static image-------| |---Promo----| |
| |                           | |            | |
Z Z                           Z Z            Z Z
| |---------------------------| |------------| |
|                                              |
| |-Static link| |-Static link| |-Latest News| |
Z Z            Z Z            Z Z            Z Z
| |------------| |------------| |------------| |
|                                              |
| |-----Possible Text (XMLblock output)------| |
| |                                          | |
Z Z                                          Z Z
| |------------------------------------------| |
|----------------------------------------------|

The problem I have is that any text inserted via the XMLblock should display at the bottom of the page, so if the promo is embedded in the XMLblock it will be difficult to make it appear at the top of the page. I know I can do this with CSS but I would prefer it if I don't have to resort to absolute positioning. So fetching the related object from the template would be the best way as far as I can tell.

As for the static content would you suggest that I insert this via the CMS?

One thing I find very frustrating about inputting elements via the XMLblock is the lack of support for block level elements like div tags. If I could input divs via the XMLblock I think this page would be extremely easy to layout.

I'm most likely making this all more confusing than it really is but I have very little experience with Ez, so finding the right way to do things the first time is a tad tricky.

Also is there any chance you could point me to a good example for retreving the promo? I have seen so many variations of the code that I'm not sure which is the best way to do it.

Cheers!

Pardon me while I burst into flames...

Gabriel Ambuehl

Tuesday 06 September 2005 1:17:40 am

You can wrap pretty much any valid XML in
<literal> </literal> tags in XMLBlock. You'll use the PDF export stuff (which is of limited use in my book) and such things, but it will display just fine.

Visit http://triligon.org

Roy Bøhmer

Tuesday 06 September 2005 1:31:38 pm

I'm afraid I don't get the problem 100%, but I'll try anyway.

As Xavier Dutoit suggests you should fetch the promos from the template. That means <i>indipendent</i> of the related objects in the node 2. http://ez.no/products/ez_publish_cms/documentation/reference/data_fetching/content/list explains how to do this.
Then you insert the fetched objects pretty much anywhere you want - comletely indipendent of any attribute from node 2.

You maybe find it convinient to override the full.tpl for node2 as well as pagelayout.tpl. At least I find it a bit more relaxing when I have to modify a template completly.

When I need to pick topstories for my frontages I usally avoid using the related content-feature. This is mainly because I can't controll the order of the objects. In stesad I add two attributes to the class: one ezObjectRelationList (ORL) and one ezObjectRelation (OR). In the ORL I manualle choose the first topstories. This is usally articles, but you can offcourse use your promp-class.
The object/node in OR holds the parent from which the x newst stories should be fetched from.

In the template I then use spesific views ( http://ez.no/products/ez_publish_cms/documentation/reference/template_functions/gui/content_view_gui ) to present the topstories. You don't need to do that, but if you do so you can set up several classes to have their own "promo-view". For me it has (almost) ruled out the need for an own promo-class.

I know this is not the intended use of ORL but...

Hope this can help, or at least give you some ideas.
- Roy

Nathan Kelly

Tuesday 06 September 2005 4:39:40 pm

Thanks for the suggestions, it's still a little fuzzy in my head but there are a couple of ideas here that I had not considered.

From all that has been said can I assume that I don't necessarily need to use related objects?

I figured that relating 1 particular promo to the home page at a time would be the most logical solution, but I'm still a little unsure of what other options (if any) are available.

Again thanks, I'll do some experimenting with the ideas expressed and see what I come up with.

Cheers!

Pardon me while I burst into flames...

Xavier Dutoit

Wednesday 07 September 2005 1:59:13 am

Hi,

Thanks Roy for sharing your trick.

I prefer to create a few extra nodes (in the media folder usualy), eg "top stories, promo home page, items in the left hand column...".

On the overrided templates (eg the home page one), I fetch the children of these nodes with some extra rules (eg, fetch only the latest children from the promo...).

If I need to order some of these items (eg the news), I use the order by priority rule for the children of the node 'top stories' and set the prio by hand et voila !

A last trick: when I'm in a good mood, I create a "dummy" class for these 'structural' nodes, and I override the full and line view to display nothing, so if a user type /media/promo he doesn't the list of all the promos.

X+

http://www.sydesy.com

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

36 542 Users on board!

Forums menu