Forums / Developer / ezpagedata()

ezpagedata()

Author Message

Sylvain Gogel

Friday 04 December 2009 1:19:42 pm

I see in ezwebin there is this operator which is not documented anywhere can someone tell me what is it/how to use it?

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Łukasz Serwatka

Tuesday 08 December 2009 1:14:37 am

Hi,

General idea behind introducing the ezpagedata() was the move complex eZ Publish template code outside of pagelayout.tpl and use PHP for it. Mainly for better performance. You can inspect data returned by ezpagedata() using attribute template operator. There is no documentation about that I'm afraid.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

zurgutt -

Tuesday 08 December 2009 6:05:54 am

Once again you are additional step ahead of anyone trying to decipher how the hell ezwebin templates work. Good job!

Please at least document it, if it was really neccessary.

Certified eZ developer looking for projects.
zurgutt at gg.ee

Sylvain Gogel

Tuesday 08 December 2009 1:30:17 pm

Thanks, i dig some of the code and how ezwebin use it. Strange and Interesting

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Łukasz Serwatka

Monday 14 December 2009 12:47:20 am

"

Once again you are additional step ahead of anyone trying to decipher how the hell ezwebin templates work. Good job!

Please at least document it, if it was really neccessary.

"

It makes whole pagelayout less complex moving complex template code outside of it. Hope it is not so difficult to understand that point for you? Instead of heaving 50 lines of code, we simply get data from ezpagedata() template operator. Simple and clean. This is also what we recommend, you should know that zurgutt with your experience and knowledge about advantages and disadvantages ot eZ Publish template engine. Documentation should be provided, no doubt here, however that is documentation team job.

Please keep your irony for your self next time. This does not help zurgutt, sorry.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

zurgutt -

Tuesday 15 December 2009 7:29:34 am

"

It makes whole pagelayout less complex moving complex template code outside of it. Hope it is not so difficult to understand that point for you? Instead of heaving 50 lines of code, we simply get data from ezpagedata() template operator. Simple and clean.

"

I apologize for the acid blast earlier, let the frustration to get better of good manners. Sorry.

About $pagedata making things simpler, I vehemently disagree. It is true it makes template code shorter and probably faster, however it also makes it much much harder to understand and debug, because page construction logic is done behind the closed curtains in php.

Specific example. I tried to add left menu to the frontpage class. I expected it to be simple - disabled the HideLeftMenuClasses[]=frontpage ini setting. No luck. Looked for overriding ini settings, no luck. Debugged the setting in template, seemed correct. Started to look at template code. Totally unfamiliar. {if $pagedata.left_menu}, hm.. what could it mean? Where does $pagedata come from? Digging deeper in template it gets more confusing. Ok, im somewhat experienced, i could locate the ezpagedata.php and look at code. It is hard to make sense of - there are some comments but they are very terse and assume a general knowledge of what is going on anyway, so no help. Debugging the left_menu setting through it finally is revealed, that value from some mystery variable "$parameters" resets its value. Where does it come from? I search the kernel code, nothing. Finally grep the whole installation and find some matches in templates, in extension/ezwebin/design/ezwebin/override/templates/full/frontpage.tpl Searching more, i find this brief mention in extension/ezwebin/settings/menu.ini (not in base ini, where one would look for comments):

# DEPRICATED: use persistent_variable in node full veiw instead
# {set scope=global persistent_variable=hash('left_menu', false(),
# 'extra_menu', false(),
# 'show_path', false())}
[MenuSettings]
HideLeftMenuClasses[]

Well, deprecated means that old way should still work, but apparently it is overriden by new. So i add it to my frontpage.tpl override and finally get a left menu.

My point is, if radical changes like that are done to template flow, which are not obvious by looking at templates, they should be abundantly commented both in template and php code. Otherwise many people are going to be very unhappy after losing hours of time tracking this down. If they are capable to do it at all. There is no way a beginner user could figure this out.

So it could be extremely helpful if you:

  • Create a documentation page, thoroughly explaining this variable and new way of compiling pages.
  • Mention this variable in "variables in pagelayout" section of docs, linking to detailed docs page.
  • Mention it in release notes, with link to docs.
  • Add a comment about usage of this variable in beginning of pagelayout.tpl, linking to the docs.

thanks

Certified eZ developer looking for projects.
zurgutt at gg.ee

Bertrand Dunogier

Tuesday 15 December 2009 1:06:16 pm

While I disagree with the critics about ezpagedata(), I fully agree with the documentation part. The first time I faced ezpagedata(), I was really confused.

We had long, very very long discussions about the role of ezwebin, and what it exactly is _ we were in Leuven, to be more accurate, others from eZ will remember it ;)

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Gaetano Giunta

Tuesday 15 December 2009 3:16:12 pm

I'm on Zurgutt's side on this one - as far as I'm concerned the docs for that function should read: "CAVE CANEM - this thing is fast and wicked but messy and complex, and its only purpose in life is to work with the ezwebin design templates. If you need only some part of its functionality you're probably better off rewriting the code on your own"...

As for what ezwebin is, it's a good question, and it applies somewhat to ezflow, too. Both package together content classes, design and new functionality (template operators, datatypes, etc). I was not in Leuven, but I think that the current split of ezwt out of ezwebin is a very good idea.

Principal Consultant International Business
Member of the Community Project Board

Jérôme Vieilledent

Monday 21 December 2009 3:10:27 am

Well, I really agree that it should be a doc for this REALLY USEFUL operator. I first faced it few weeks ago and I was really pleased to be able to use a cool operator for complex operations in pagelayout (and that fixes common issues like accessing to content_info in a non-content module)

But... We are developers right ? As I couldn't find any docs about it, I just dug into the code and found out what I was looking for ! Documentation should be here for sure (at least a PHPDoc one), but we all can look into the code when we find something we don't know. It's sometimes much quicker...

Sergi A

Friday 15 January 2010 4:36:39 am

I found exactly the same problem as zurgutt -.... coudn't add the left menu to the frontpage and finally commenting the line

HideLeftMenuClasses[]=frontpage

on extension\ezwebin\settings\menu.ini.append.php the left menu appeared....

i'm just wondering if it is the right way or i may have problems in the future by doing that...

thanks,

Sergi.

Heiner Wurbs

Sunday 21 March 2010 11:07:01 am

Hi folks,

the ezpagedata is a miracle. I just found out, that it is related to the Look&Feel in the Design Tab. So I copied for a second siteaccess the Template look object and modified the new one. A miracle is now, which of these both Template look objects the ezpagedata will take. Fortunately in one siteaccess it is the right one :)

I suppose, this will be the same as the section template command - used everywhere, documented nowhere

Greetz Heiner

Heiner Wurbs

Sunday 21 March 2010 12:45:29 pm

Copying the "Template look" object is not working ... dont know, how this ezpagedata works....

zurgutt -

Saturday 31 July 2010 11:07:52 am

Searching for pagedata and ezpagedata in documentation gives zero results.

Please document its usage.

Certified eZ developer looking for projects.
zurgutt at gg.ee

Dino Ursic

Saturday 28 August 2010 4:04:40 pm

"

I found exactly the same problem as zurgutt -.... coudn't add the left menu to the frontpage and finally commenting the line

HideLeftMenuClasses[]=frontpage

on extension\ezwebin\settings\menu.ini.append.php the left menu appeared....

i'm just wondering if it is the right way or i may have problems in the future by doing that...

"

Hi all,

I just wated to share my thoughts on the topic... As much as I agree with zurgutt that ezpagedata (as well as any other template operator, for that matter) should be at least somewhat documented, I must say that the source of your HideLeftMenuClasses issues is not in the maldocumented template operator, but instead in a very small begginer's mistake in menu.ini cofiguration for the ezwebin extension.

Zurgutt correctly noted that in extension/ezwebin/settings/menu.ini.append.php it states following:
# DEPRICATED: use persistent_variable in node full veiw instead
# {set scope=global persistent_variable=hash('left_menu', false(),
# 'extra_menu', false(),
# 'show_path', false())}
[MenuSettings]
HideLeftMenuClasses[]

...but as far as I'm able to see, the source of the issue is not in the allegedly overriden configuration functionality. My debugging showed that the source of the problem is in the fact that [MenuSettings] configuration contains line "HideLeftMenuClasses[]", which as a result will define a list on it's own rather than allow completion of the list with value from the siteaccess and default settings. Once I removed this line from the ezwebin's menu.ini.append.php, everything fell in place, meaning all of my siteaccess' and other extensions' HideLeftMenuClasses configuration were propperly loaded.

Hope this will help someone not to lose 2hrs+ on debugging as I did.

Cheerz from Croatia

http://share.ez.no/community/profile/98888

zurgutt -

Wednesday 01 September 2010 6:12:01 am

 

Searching for pagedata and ezpagedata in documentation gives zero results.

Please document its usage!

Todays hint: CurrentMenu does not anymore do what it is supposed to do, instead the pagedata seems to take in account LeftMenu and TopMenu. So to turn off topmenu setting CurrentMenu=LeftOnly does not work but instead you have to set "TopMenu=". Ways of pagedata are mysterious..

I have resolved to update this thread every time me or someone else has wasted time to this abomination, until proper documentation exists or even better, it is removed.

Certified eZ developer looking for projects.
zurgutt at gg.ee

Andy Caiger

Tuesday 14 September 2010 10:40:08 pm

Yes, I agree with zurgutt. Please document this!

EAB - Integrated Internet Success
Offices in England, France & China.
http://www.eab.co.uk http://www.eab-china.com http://www.eab-france.com