Forums / Developer / PHP: attribute_view_gui -like output

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