eZ Community » Forums » Developer » Tidy output extension?
expandshrink

Tidy output extension?

Tidy output extension?

Wednesday 31 January 2007 12:02:40 am - 48 replies

I was wondering if there is already or anyone would be interested in an extension that took all of the potentially messy html outputted by eZ and tidy'ed it up (probably using the tidy engine). If there is not one already out there, I thought I'd try my hand at creating it. Let me know your thoughts.

In case you're not familiar with Tidy... http://tidy.sourceforge.net/

--Andrew

Modified on Wednesday 31 January 2007 12:09:50 am by Andrew K

Monday 12 February 2007 4:49:08 pm

Ok. It's finally in pubsvn (http://pubsvn.ez.no/community/trunk/extension/eztidy/ ). I did not put any comments in the code, which I plan to do, but it should be pretty self-explanatory. Let me know what you think.

I think putting the tidy path into a settings file would be good and maybe a switch for the user to either select the tidy method (php functions or executable) or have it choose automatically like it does now. The tidy.ini file is a tidy config file which both the cli and the php function can accept, so I would think we'd want to keep it in that format.

--Andrew

Modified on Monday 12 February 2007 8:05:12 pm by Andrew K

Monday 12 February 2007 5:36:26 pm

Andrew,

Many thanks for your contribution!

You took the additional responsibility as a challenge and the results show it! Well done.

Cheers,
//kracker

Clint Mansell & Kronos Quartet - Dreams III

Monday 12 February 2007 8:07:15 pm

Well done Andrew! I added a reference to your operator on http://ezpedia.org/wiki/en/ez/template_language_for_php_developers

Modified on Monday 12 February 2007 8:15:36 pm by Kristof Coomans

Thursday 08 March 2007 7:36:41 am

Hello

How can I use the operator?

I tried

{$module_result.content|eztidy}

I ended up with empty page. Then I tried the following and the page is shown but the code is not tidyed.

{$module_result.content|tidy('string')}
{$module_result.content|tidy()}
{$module_result.content|tidy}

Modified on Thursday 08 March 2007 7:37:15 am by Softriva .com

Thursday 08 March 2007 4:44:34 pm

OOzy Pal,

Try eztidy($module_result.content). That should work.

--Andrew

Thursday 08 March 2007 5:59:35 pm

Thank you Andrew.

I have updated the example usage in eZpedia documentation,
http://ezpedia.org/wiki/en/ez/tidy#eztoc98287_2

Thursday 08 March 2007 6:54:32 pm

I did not work for me. I am sure I am doing something wrong but can't seem to figure it out. I did activate the extension in the override site.ini.append.php.

Can some help me troubleshoot the problem?

Thursday 08 March 2007 7:07:31 pm

Then the next step would be to see if your php has the tidy functions. Go to Setup -> System Information in your eZ admin and see if "tidy" is listed in the PHP, Extensions section.

If it's not there, then eztidy will try to use a tidy binary. There is a $tidy_path variable in eztidy/autoloads/eztidy.php that holds the path to the tidy executable. Make sure that path is correct.

--Andrew

expandshrink

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

36 542 Users on board!

Forums menu