PHP: attribute_view_gui -like output

Author Message

Pascal Specht

Wednesday 10 September 2008 2:25:59 am

Hi there,

the title may be misleading, I'm looking for a way to get the rendered html that attribute_view_gui generates from a xhtml attribute. In other words, is there a way to convert an xhtml attribute to html like {attribute_view_gui attribute=my_xhtml_attribute} does ?

Thanks for any ideas,
</Pascal>

Ivo Lukac

Wednesday 10 September 2008 3:04:15 am

Hello Pascal,

try this: {$your_xhtml_attribute.content.output.output_text}

.... a while later .....

I just noticed that you want to do it in PHP. I presume above variables are the same just syntax would be different.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Pascal Specht

Wednesday 10 September 2008 7:19:51 am

Hi Ivo,

Thanks for your answer. I've looked into the details I can see inside the attribute, and the only one accessible from PHP that seems to contain something suitable is data_text, I couldn't see any output_text in PHP (although I know it's available in eZ templates).

the data_text unfortunately contains XML markup and doesn't look like valid xhtml I could render out without the attribute_view_gui function. It still contains paragraph, section, strong and similar tags, too.

So, I'm still stuck...

</Pascal>

Ivo Lukac

Wednesday 10 September 2008 8:08:04 am

attribute_view_gui automatically uses output handler, so you need to do it manually in PHP.
Class to use is in kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

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

eZ debug

Timing: Jan 31 2025 01:18:46
Script start
Timing: Jan 31 2025 01:18:46
Module start 'layout'
Timing: Jan 31 2025 01:18:46
Module start 'content'
Timing: Jan 31 2025 01:18:46
Module end 'content'
Timing: Jan 31 2025 01:18:46
Script end

Main resources:

Total runtime0.0353 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 588.1406151.2109
Module start 'layout' 0.00670.0044 739.3516220.7031
Module start 'content' 0.01120.0219 960.05471,001.8047
Module end 'content' 0.03310.0022 1,961.859433.9922
Script end 0.0352  1,995.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00318.8113140.0002
Check MTime0.00123.3274140.0001
Mysql Total
Database connection0.00092.450210.0009
Mysqli_queries0.003610.118130.0012
Looping result0.00000.039810.0000
Template Total0.00154.310.0015
Template load0.00123.297710.0012
Template processing0.00030.948910.0003
Override
Cache load0.00082.357010.0008
General
dbfile0.003810.783980.0005
String conversion0.00000.019640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs