Ez Script Problem

Author Message

Pierandrea Della Putta

Monday 14 December 2009 3:00:02 am

Hi to all.

I have a big problem. When I program ez template, example override pagelayout.tpl and I try it, the HTML code have many white rows that are ezscript compile, I think.

Than, is there anyway to remove that rows?!

For google indicization white rows not are the best :(

Thank for help

Robin Muilwijk

Monday 14 December 2009 12:29:41 pm

Hi,

Would it be possible for you to post a link to a screenshot of that code and the white lines? Right now I'm guessing you are looking at the pagelayout.tpl file itself, and that code has white lines between each line of code?

Regards Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Pierandrea Della Putta

Tuesday 15 December 2009 5:25:05 am

Exactly, where is the eZScript code, ez compile let many rows white when are the line of script.

Example, in top of pagelayout,tpl

{def $_AAA = fetch('content','list',hash('parent_node_id',2))}

{foreach $_AAA as $_element)

{$_element.name|wash()}

{/foreach}

....html code ....

the compile result will be 4 line white and follow html code...

The only way that I found to resolve this problem, was be a bash script that is

#!/bin/bash
echo "Compmpress tpl "$1
echo
cat $1 | tr -d "\n" > $1.1
cat $1.1 | tr -d "\t" > $1.2
rm $1.1
mv $1 $1.bak
mv $1.2 $1
echo "Save file "$1.bak

that remove \n and \t from orginal tpl and save the backup. I think will make an extension for this. :)

But if there is another way, please, tell me.

Robin Muilwijk

Tuesday 15 December 2009 11:14:48 am

So,

If I understand correctly, the pagelayout.tpl which generates the page e.g. html is also creating those white lines?

If so, what version of eZ are you using, and which pagelayout.tpl is this? Can you add the path for that file?

Thanks Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Pierandrea Della Putta

Thursday 17 December 2009 1:08:52 am

Weel, I use Ez 4.1.3 and Ez 4.2.

I repeat the situation: If I write EzScript on the top of the template or everywhere in template when EzPublish compile it, the html output have white lines where EzScript was be write.

With ez 3.x was be all OK

Robin Muilwijk

Saturday 19 December 2009 11:05:27 am

Hi,

I've asked one of the eZ Crew people to have a look at your question, it's beyond my knowledge I'm afraid.

Regards Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Nicolas Pastorino

Tuesday 22 December 2009 3:07:18 am

Hi,

The issue you are raising is not surprising. When running such a piece of eZ Publish template language :

{def $children = fetch('content','list',hash('parent_node_id',2))}
{foreach $children as $child)
   {$child.name|wash()}
{/foreach}

every line break in your code most of the time triggers a line break in the final output HTML.
In order to reduce the amount of line breaks in the final HTML, you may want to use as few of those as possible in the template code. If this still is really problematic ( you were mentioning Google crawling, any pointer to how harmful this can be for your rank ?), then considering washing the output HTML probably is the way to go.

Glad to hear your feedback on this,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

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