Forums / Developer / About the cluttered pagelayout.tpl

About the cluttered pagelayout.tpl

Author Message

Nicklas Lundgren

Thursday 14 July 2011 11:51:35 am

Hi folks,

As I am working my way through the development phases of a new website in the 2011.6-edition, one thing keep coming back into my mind.

I have been working with eZ Publish since 2002, and the pagelayout.tpl is just getting more and more complex, not to say cluttered.

I know the ezwebin-thing in combination with the ezpagedata operator needs all that stuff... at least I know that is what the core developers will say.

IF all those include-files and code really need to be there - why not put solid, genuine comments above them, so that we all know, without hesitation, what we can remove, and what needs to stay.

For instance - what about the

 {include uri='design:page_head_displaystyles.tpl'}

What is that? I have been looking through this site and all documentation, but I just cant find the answer. What is the purpose of these lines?

 {* NOTE: Can not be inside a cache-block, unless it has user id as key! *}
<style type="text/css">
.limitdisplay-user {ldelim} display: none; {rdelim}
.limitdisplay-user-{$current_user.contentobject_id} {ldelim} display: inline; {rdelim}
.limitdisplay-user-block-{$current_user.contentobject_id} {ldelim} display: block; {rdelim}
</style>

I admit this is not a too big problem for me, but what about new developers, that are interested in learning eZ from scratch?

I think a solid, simple pagelayout.tpl will gain the eZ Publish system more than unpredictable features that is not to find a trace of in any documentation. It ought to be possible to improve this, also with better comments and documentation.

Nicklas Lundgren, Managing Director
Novitell AB, Sweden

André R.

Thursday 14 July 2011 1:07:35 pm

You have a valid point regarding comments, as for pagelayout now compared to a few years back some effort was put into making it more customizable and less cluttered so same pagelayout could be used across ezwebin and flow for instance.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Nicklas Lundgren

Thursday 14 July 2011 2:13:00 pm

Thanks for your input, André.

I understand the reasons for the pagelayout.tpl evolving over time, but that is not a reason for letting it become cluttered and hard to understand. 

For instance - what is the reason for adding a variable for the ez basket in pagelayout.tpl - if you dont even use the shop in your site...?

Well, as always with eZ Publish, I would be happy if we at least could get proper documentation and comments in place. That is the weakest point in this otherwise rock solid system.

Cheers,

Nicklas 

Nicklas Lundgren, Managing Director
Novitell AB, Sweden

Gaetano Giunta

Monday 18 July 2011 6:46:54 am

You can always start from scratch with a clean pagelayout and avoid usage of ezpagedata and most other stuff (I'd just recommend to go with ezcss_load and ezscript_load) if you want. In fact that's the approach we usually take for eZ Publish trainings, as the flexibility and modularity of the ezflow/ezwebin pagelayouts comes at the price of simplicity.

Principal Consultant International Business
Member of the Community Project Board

Tomislav Buljević

Thursday 21 July 2011 2:45:32 am

In my experience, the best policy is just to make some minor modifications to the file you're wondering about and see what happens (I mean the files which are not commented). It may be a n00b approach, but it's the best we've got (as far as non-documented files are concerned).