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.

eZ debug

Timing: Jan 18 2025 11:03:04
Script start
Timing: Jan 18 2025 11:03:04
Module start 'layout'
Timing: Jan 18 2025 11:03:04
Module start 'content'
Timing: Jan 18 2025 11:03:05
Module end 'content'
Timing: Jan 18 2025 11:03:05
Script end

Main resources:

Total runtime0.9016 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 588.9141152.6094
Module start 'layout' 0.00850.0041 741.523439.4141
Module start 'content' 0.01250.8875 780.9375657.9844
Module end 'content' 0.90000.0015 1,438.921920.1875
Script end 0.9015  1,459.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4433160.0002
Check MTime0.00130.1402160.0001
Mysql Total
Database connection0.00130.144710.0013
Mysqli_queries0.799888.7093710.0113
Looping result0.00080.0906690.0000
Template Total0.845693.820.4228
Template load0.00310.342120.0015
Template processing0.842593.447020.4213
Template load and register function0.00010.014710.0001
states
state_id_array0.00390.429710.0039
state_identifier_array0.00250.275120.0012
Override
Cache load0.00230.2534730.0000
Sytem overhead
Fetch class attribute can translate value0.00070.080430.0002
Fetch class attribute name0.00890.9886100.0009
XML
Image XML parsing0.00450.504530.0015
class_abstraction
Instantiating content class attribute0.00000.0041140.0000
General
dbfile0.00540.5943300.0002
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
13content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 52
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs