Share » Forums » General » dead end? section basic problem

dead end? section basic problem

dead end? section basic problem

Sunday 10 October 2004 12:05:44 pm - 4 replies

Author Message

Paul Borgermans

Sunday 10 October 2004 1:29:09 pm

Hi Lior,

I understand your problem quite clearly and it has been discussed in the past here. To me it is still .. ahum ... a design flaw in ez publish. The current implementation of the additional locations and the (non)inheritance of sections makes it behave just as a link, nothing more.

Now, I'm pretty sure you can work around this in the templates, but it is not straight forward. Since you delved arleady quite deep into ezpublish, this is what I would do if you followed the traditional approach to have folders as containers for children (it is actuallay an approach which will be included in the next update of the ez book):

<i>make an override template for your folder which fetches your children as usual, but instead of using the url_alias to create the links to your "full object view", create a link to your main folder with additional url arguments on what to display</i>

For example, Say your library node and additional locations is as follows with your effective siteaccess as other main trees in your site:

<library>    <siteaccess a>    <siteaccess b>

<item1>      <item1>          <item2>
<item2>      <item3>          <item3>
<item3>                       <item4>
<item4>

The re-appearance of items under siteaccess1 and siteaccess2 mean their alternate locations. For simplicity, assume these items are all articles of the same class.

Now, for siteaccess1 you can create a full view template for the article class called for example article_view_full_a.tpl. The trick is now to assign this to a "custom" view mode, say "full_a" in your override.ini tied to the siteaccess a. Note that you are not limited to traditional line/view/embed views in ezp :-) Similar for siteaccess2, where you create another alternative full view to your article class.

Now for your folder view templates in the various siteaccesses, create overrides that will take into account the above.

It should be something like this (the simpliest for clarity, but it is the principle that counts):

{*override for a folder view mode full*}
{section show=$view_parameters.show}
   {* we are called with the request for a full view *}
   {let thisnode=fetch(content,node,hash(node_id,$view_parameters.show)}
   {node_view_gui viewmode="full_a" content_node=$thisnode}
   {/let}
{section-else}
   {* we need to display a list of children *}
   {let children=fetch(content,list,hash(parent_node_id,$node.node_id))}
   <ul>
   {section loop=$children var=child}
   <li><a href=concat($node.url_alias,'/(show)/',$child.node_id)|ezurl}>{$child.name}</a></li>
   {/section}
   </ul>
{/section}

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Paul Borgermans

Sunday 10 October 2004 1:33:18 pm

If our siteaccesses are well separated, you can of course still use the "full" view mode, but simply redefined in each siteaccess design/override folders. The pagelayouts like this will be as intended too (coupled to your siteaccess)

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Rami Grossman

Monday 11 October 2004 12:49:12 am

Hi Paul,
Thanks for the reply.
I work with Lior.
The problem is not only how to view the article itself but we use the secsion of each object to show different design for each object. for example we have objects that will be shown under the section "University" and others unders "free lessons". Its very natural to override the pagelayout for each section with its own design. But with the limitation that eZ has with the multi sections for each object according to its locations we can't use this feature.
We can work around it maybe if we put a piece of the code intended to be in the pagelayout in the object override tpl and use like you said different views for each design section, but its like walking on the hands and this way we don't use the most powerful feature of eZ.

Are there any other sujestions?

Rami

Lior Solomon

Wednesday 13 October 2004 7:48:39 am

Thank you Paul for the reply
what would you think about this solution:
since i dont want to complicate the process for the editor, cause once i will use your solution publishing links on any article will ask for knowing which parameters to pass and so on. i came up with this idea tell me what you think:
create a module or actualy an ez function(i'm sure that is posible) that i will pass the object id to this function and it will use the db to discover what is the section of the parent folder. since parent folders will always have the real section then i can tell by that to which section the article belongs.
and then i dont need to change any of the url structure.
what do you think?
is it posible to create a builtin function in ez?
so tpl will use it?

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

36 542 Users on board!

Forums menu