How do you display an Object which is not the main object.

Author Message

Michel Houtermans

Tuesday 10 February 2004 11:46:40 am

I created an object and added to two locations. If I want to display the object in the main location I have no problem. I just fetch the contents of the folder and it works, I create an override and it works.

Now when I go to the second folder I cannot get the same object to be displayed. The fetch simply does not work.

In the admin it looks like this:

Folder 1
-> object (node id: 137, object id: 140)
Folder 2
-> object (node id: 138, object id: 140)

The main location is folder 1. What kind of fetch do I need in folder 2 to display the object? Do I need to use the parent_node_id of folder 1 in the folder 2 template? Or how does this work?

Michel Houtermans

Tuesday 10 February 2004 12:15:29 pm

I think the problem has to do with the line view override template. Some how he does not want to display that template.

Folder 1 is section 5
Folder 2 is section 4

I now created a line view override for class 21 and section 4. But does not go in there to display the content of it. Is the wrong because of the different locations?

Marco Zinn

Tuesday 10 February 2004 1:22:44 pm

Hi, to remove possible "point of failures", I suggest, that you just use one section and one template (no overrides), until your node 138 shows up at all (if this is possible for the moment). Also, make sure, that "anonymous" can read your content class and section in any case (or log in as admin user).
The default templates do not care, if the object is in it's main node or not. The List-"Fetch", that is used, operates on "nodes", not objects, and for that, your two nodes are of the same kind. There is no "main" and "copy" or so.
So, the node should show up in the templates, just as it should show up in the admin interface.
(Note: I think, the "tree"-Fetch function does NOT send duplicate object nodes).

Marco
http://www.hyperroad-design.com

Michel Houtermans

Wednesday 11 February 2004 8:10:22 am

Ok the fetch in folder 2 works but the line view override does not want to work.

I can see the object 140 in folder 2 but as the standard line template. He refuses to take the new line view template I created for this one. It really starts to puzzle me why it does not work.

Michel Houtermans

Wednesday 11 February 2004 8:34:16 am

In Folder 1 I use the treemenu2 extension as can be found on ez publish. The treemenu represents the content of folder 1 and when you go down the tree you come eventually to the above object (140). Basically the tree is a line view of the object. When you click on the object in the tree then it opens the full view of the object. I noticed that when I click on the object in folder 2 it opens the same full view as in folder 1 for this object.

Can this treemenu2 extension be the problem?

Michel Houtermans

Wednesday 11 February 2004 12:51:20 pm

the problem seamed so hard yet it was so easy. Here is what i did wrong

Both folders were assigend a section.

Since I created the object in Folder 1, the same object in Folder 2 still belongs to the sectoin of Folder 1. Thus the override I created for folder 2 was based on the wrong section.

Fixed the section and now it worx ;-)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.