eZ Community » Forums » Developer » About the cluttered pagelayout.tpl

About the cluttered pagelayout.tpl

About the cluttered pagelayout.tpl

Thursday 14 July 2011 8:51:35 pm - 4 replies

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}

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.

Modified on Thursday 14 July 2011 9:17:23 pm by Nicklas Lundgren

Thursday 14 July 2011 10: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.

Thursday 14 July 2011 11: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.



Monday 18 July 2011 3:46:54 pm

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.

Thursday 21 July 2011 11: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).


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

36 542 Users on board!

Forums menu

Proudly Developed with from