Placeholder for content aggregation in templates

Author Message

Jan Komárek

Wednesday 08 December 2010 7:41:39 am

Hello,

is possible to create something like placeholder view helper from Zend Framework in EZ Publish templates? For example aggregation of JavaScript code in JQuery document ready function, or dynamicly added javascript and css files.

I have few pages in site, which are heavily utilized with JS widgets, validations and so on and I dont want to have JS files related to concrete pages loaded everywhere.

EZ Publish 4.3 but EZ Webin in version 1.2

Thanks a lot,
Vebloud

Łukasz Serwatka

Sunday 12 December 2010 3:50:18 pm

You can use lazy loading for your JavaScript / CSS files with ezjscore templates functions. Or use JavaScript library like YUILoader for instance to load CSS or JavaScript on demand on pages where needed.

http://share.ez.no/learn/ez-publish/ezjscore-ez-publish-javascript-and-ajax-framework/(page)/6

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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 29 2025 13:40:24
Script start
Timing: Jan 29 2025 13:40:24
Module start 'layout'
Timing: Jan 29 2025 13:40:24
Module start 'content'
Timing: Jan 29 2025 13:40:24
Module end 'content'
Timing: Jan 29 2025 13:40:24
Script end

Main resources:

Total runtime0.0143 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 588.2656151.2266
Module start 'layout' 0.00430.0030 739.492236.6875
Module start 'content' 0.00730.0057 776.179790.2031
Module end 'content' 0.01300.0012 866.382829.9766
Script end 0.0143  896.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002215.2517140.0002
Check MTime0.00106.8236140.0001
Mysql Total
Database connection0.00053.360910.0005
Mysqli_queries0.002517.675930.0008
Looping result0.00000.111910.0000
Template Total0.00096.110.0009
Template load0.00074.719910.0007
Template processing0.00021.372410.0002
Override
Cache load0.00043.053710.0004
General
dbfile0.00138.984180.0002
String conversion0.00000.063440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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