Forums / General / Ez Script Problem

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

eZ debug

Timing: Jan 30 2025 00:52:35
Script start
Timing: Jan 30 2025 00:52:35
Module start 'content'
Timing: Jan 30 2025 00:52:35
Module end 'content'
Timing: Jan 30 2025 00:52:35
Script end

Main resources:

Total runtime0.2327 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 587.8047180.8516
Module start 'content' 0.00780.0053 768.6563102.0234
Module end 'content' 0.01310.2195 870.6797529.9844
Script end 0.2326  1,400.6641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.4912200.0002
Check MTime0.00150.6373200.0001
Mysql Total
Database connection0.00140.590510.0014
Mysqli_queries0.188280.89261410.0013
Looping result0.00120.53111390.0000
Template Total0.219294.210.2192
Template load0.00080.328810.0008
Template processing0.218493.860510.2184
Override
Cache load0.00050.232110.0005
Sytem overhead
Fetch class attribute can translate value0.00060.264810.0006
XML
Image XML parsing0.00020.093810.0002
General
dbfile0.00582.5060200.0003
String conversion0.00000.003530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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