Forums / Suggestions / ez.no template evaluator

ez.no template evaluator

Author Message

Paul Forsyth

Friday 16 April 2004 1:28:18 pm

Template code can be tricky to get right when coding. It would be nice to have a way to evaluate simple template code in a sandbox environment.

It would be nice to have a page on ez.no where a textarea box would take template code, execute it (subject to sanity checks...), and display the results. Documentation on the ez.no site could then take advantage of the feature and be able to offer links to send template code to the evaluator to show particular pieces of code in action.

paul

--
http://www.visionwt.com

Jan Borsodi

Tuesday 11 May 2004 12:43:53 am

A nice idea, but I guess the major problem is the input variables.
A lot of the template code relies on having content objects, nodes etc. to work, without this you would only be able to check simple code snippets.
If a smart way is found to handle the variable issue then it could be quite powerful, it could even be linked to the template listing i the admin interface (A validation of template code when you stor it would be nice too).

This and other types of sandbox enviroments, for instance email generation (I think this has been suggested earlier also), can be quite useful.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Paul Forsyth

Tuesday 11 May 2004 1:35:56 am

Yes, input variables would be difficult in a proper sandbox environment.

A simple version may only allow operators that dont need information from the db, but this wouldn't be of much use i think.

In the next level a suite of pre-constructed arrays could be available for use. Again, this could be too limiting.

The best solution would for access to a demo site and its db. Your demo sites may be ideal as the dbs are restored regularly. A read only db could be used for ez.no examples. Another benefit would be that the template eval module could be used locally, because of its dependancy on a sole db.

paul

--
http://www.visionwt.com

Alex Jones

Wednesday 12 May 2004 6:29:05 am

Also, another tool that I think may prove handy would be something that allows us to see all of the un-rendered template code used to display a page. Some of my pages pull quite a few templates, causing me to wonder if I may have missed a closing <i>let</i> or <i>section</i> tag. So, it would be nice to have an alternate view that shows me all of the eZ code, including templates that are called via include tags without making any of the db calls. This will also help those of us who are rather picky about our HTML output as we could easily figure out where to put our indents, line breaks etc.

Just a thought,

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Paul Forsyth

Thursday 13 May 2004 12:33:59 am

Alex,

THe ez debug output displays some of this right now, albeit its often not what the error is referring to. Are you speaking about inline errors, errors that display with the html? That would be useful.

paul

--
http://www.visionwt.com

Alex Jones

Thursday 13 May 2004 5:52:14 am

Actually, I'm not speaking about errors at all. ;) What I would like is the equivalent of viewing the source of a Web page - but for eZ code. Ultimately, this view would display every line of code that eZ publish would convert before sending the results to the browser. My goal is to see which tags (eZ & HTML) are opened and closed, and for that matter where they are opened and closed. Right now, to get this perspective I would have to open many different template files and piece them together mentally.

This isn't a big deal, but I think it would prove helpful. Does this make sense?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Paul Forsyth

Friday 14 May 2004 12:41:02 am

That could be easy to do. All we really need is another log file, which could be entered to if a setting is active, and displayed on screen if another setting is active.

I think PHP can capture output quite easily. Though we really need to colour the resulting code according to some syntax checker to help with problem areas.

paul

--
http://www.visionwt.com

Alex Jones

Friday 14 May 2004 6:21:46 am

Color-coding would be a great addition. I still need to find a way to do that in DreamWeaver.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

eZ debug

Timing: Jan 18 2025 11:11:04
Script start
Timing: Jan 18 2025 11:11:04
Module start 'content'
Timing: Jan 18 2025 11:11:06
Module end 'content'
Timing: Jan 18 2025 11:11:06
Script end

Main resources:

Total runtime1.4629 sec
Peak memory usage4,096.0000 KB
Database Queries211

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 587.7109180.8359
Module start 'content' 0.00871.2780 768.5469638.6250
Module end 'content' 1.28670.1762 1,407.1719342.8672
Script end 1.4629  1,750.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.2853210.0002
Check MTime0.00160.1078210.0001
Mysql Total
Database connection0.00110.071810.0011
Mysqli_queries1.370093.65072110.0065
Looping result0.00270.18642090.0000
Template Total1.422597.220.7113
Template load0.00210.142020.0010
Template processing1.420497.095420.7102
Template load and register function0.00020.015410.0002
states
state_id_array0.00180.121810.0018
state_identifier_array0.00250.167820.0012
Override
Cache load0.00180.1231480.0000
Sytem overhead
Fetch class attribute can translate value0.00230.155240.0006
Fetch class attribute name0.00110.0759100.0001
XML
Image XML parsing0.00160.107640.0004
class_abstraction
Instantiating content class attribute0.00000.0016120.0000
General
dbfile0.00320.2206340.0001
String conversion0.00000.000730.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs