Monday 06 June 2011 2:00:16 pm - 2 replies

Introduction

This is a short tutorial about using the powerful combination of AJAX (jQuery) and eZ Publish. Please note this was also originally released before the REST API was developed for the current community release of eZ Publish.

» Read full blog post

Author Message

Ivo Lukac

Friday 10 June 2011 12:17:17 pm

Hi Brandon,

Very nice job and thanks for the reminder about the eZ Find tutorial :)

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Gaetano Giunta

Monday 13 June 2011 12:56:44 am

Good introduction!

A couple of devious alternatives, that might be worth exploring:

  • xml or json, to be consumed by ajax calls, can be produced by templates too. Using an url similar to /layout/set/json/content/view/json/57, and providing the corresponding templates, you can make ajax calls that fetch the data by using a "proxy" node as service provider. Benefit: you get the caching opportunities of the template system. Downsides: templates are slower to execute than pure php code, at least on 1st run; this can only be used by default to view data, not to manipulate it (unless you produce json/xml templates for other views than content/view). An extension that provides xml and json templates to get you started quickly on this path: ggxmlview
  • the ezwebservicesapi extension (which can use either ezjscore or ggwebservices for the transport layer) allows developers to access all existing template fetch functions (including custom ones) without having to write a single line of code. It can be a great timesaver for the ajax developer. Ps: it even allows to execute existing modules/views using ajax calls, but the results can be quite surprising, depending on the module.

Principal Consultant International Business
Member of the Community Project Board

You must be logged in to post messages in this topic!

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 17 2025 23:45:24
Script start
Timing: Jan 17 2025 23:45:24
Module start 'layout'
Timing: Jan 17 2025 23:45:24
Module start 'content'
Timing: Jan 17 2025 23:45:24
Module end 'content'
Timing: Jan 17 2025 23:45:24
Script end

Main resources:

Total runtime0.1273 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.0703152.6250
Module start 'layout' 0.00610.0027 741.695339.4531
Module start 'content' 0.00880.1171 781.1484662.5313
Module end 'content' 0.12590.0013 1,443.679718.3984
Script end 0.1272  1,462.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00332.5544160.0002
Check MTime0.00131.0347160.0001
Mysql Total
Database connection0.00100.811610.0010
Mysqli_queries0.067252.8075670.0010
Looping result0.00060.4841650.0000
Template Total0.098077.020.0490
Template load0.00211.634220.0010
Template processing0.095975.335320.0479
Template load and register function0.00020.127410.0002
states
state_id_array0.00221.742920.0011
state_identifier_array0.00120.946130.0004
Override
Cache load0.00181.3903170.0001
Sytem overhead
Fetch class attribute name0.00131.036650.0003
Fetch class attribute can translate value0.00060.495920.0003
class_abstraction
Instantiating content class attribute0.00000.007950.0000
XML
Image XML parsing0.00100.755020.0005
General
dbfile0.00080.6321230.0000
String conversion0.00000.007940.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.tplforum_topic/full.tplextension/community_design/design/suncana/override/templates/forum_topic/full.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
2content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs