#008093: Template Speed Enhancements using JSON

Description:

Speeding up ez with javascript and node.children, while still being 100% backwards compatible with orginal 3.6 -3.8 templates even if client have JavaScript turned off.

Also contains new functionality, clicking on a picture in the gallery now shows original picture (full screen)

folder.tpl Paging speed up: (click next / prev)
http://sbio.no/hovedforeningen/linker/interesseutvalgurl

gallery.tpl Gallery Paging Speed up:(click next / prev)
http://www.sbio.no/utvalg/insa/gallery/buddy_dinnerurl

image.tpl Gallery Speed up & full screen mode: (click next / prev & click on image)
http://sbio.no/utvalg/bull/bilder/oevl/samling_i_bakkenurl
http://www.sbio.no/utvalg/insa/gallery/buddy_dinner/picture_6url

Known bugs:
*using Ie6 and clicking on image to show full screen mode need some work(image does not show up in big size until you start clicking next / prev)
*sometimes ez does not obey |nl2br() witch causes JavaScript error, so the page works like before

Suggestions:
*implant the same paging in forum.tpl and forum_topic.tpl also
*gallery.tpl should be div based, no tables

  • Link to full screen mode should be more visable, best is probably to use document.write to output such a link. So people without JavaScript don't see it.

*Make 'View Slideshow' actually do what you expect it to do, view a automatic slideshow
*Add support for offset parameter and only output 50-100 sub elements at a time.


Environment:

Version: 3.6 - 3.8
PHP Version: 4.4.2
Webserver: 2.0.54
Database: 4.1.15


- Attachments
template_speed_enhancements_using_json.zip (5.3 kb)
[Download] [Permanent Link]

- Comments

Hi Andre

Wow, that's some great web 2.0 functionality I've not seen on an ezpublish site before! Combined with ezpublish's content management power, these are just the kinds of ideas ezpublish needs to incorporate into the standard template distributions to stay at the forefront of where the web is going these days and I hope the ez developers notice this enhancement suggestions. Thanks for contributing it :-) However, the code is something of a javascript 'tag soup'. Here's some food for thought...

http://webstandards.org/action/dstfurl

http://adactio.com/atmedia2005/url

Anything incorporated into the ezpublish default templates - I feel - really needs to conform to standards and be a 100% abstracted layer on top of the xhtml/css. It shouldn't be hard to do.

Thanks again Andr?this is a great start to some great ideas - I expect I will take a closer look at your code soon for a site I'm working on.

Matthew

--
http://carroll.org.ukurl

#248603 by Matthew Carroll on April 10th, 2006 [Permanent Link]

Thanks, always great with some feedback.
However, what part of the standards are you referring to.

Would you see all the json stuff moved outside the tpl files or is it that I use inline events?

I should clarify that this by no means meant to plug right into ez officially.
Before that there should at least be some kind of offset support.
Meaning that folders or galleries with lots of children (100-200++), shouldn't have all of those inline in one go.

My reason for including the json stuff inside the tpl was that you already loops thru the elements there. And if you want to have the json stuff in a js file you'll have to either have a special siteaccess with JavaScript output (and mime header) (alt: xml if you do it the ajax way). Or you'll have to have a whole new access point that goes around the template system entirely, and just outputs JavaScript data. Kind of like the xajax extension.

#248604 by André R. on April 11th, 2006 [Permanent Link]

Hi Andr?
I do see the problem, you need to have ez template loop output within the javascript. I can't see an easy way around this though - I'm no expert! I suppose a good start would be to remove the inline javascript elements and have them added dynamically by the script, so all you have is one script at the start of the template. Eventually I wonder if it would be possible to get ez to output the correct script as a separate dynamically generated .js file somehow - that's certainly an interesting concept. Keeping everything abstracted into one internal <script> block within the template would certainly ease going down this road eventually.

Anyway, good luck - I hope I gave you a few useful ideas and that you'll continue posting your code as it develops. It would be wonderful to see some of these ideas built into an extension.

Best wishes
Matthew

--
http://carroll.org.ukurl

#248605 by Matthew Carroll on April 12th, 2006 [Permanent Link]

As the comments suggest this enhancement is actually slowing down galleryes with a lot of pictures. So if the gallery really should be ajaxed it should load the pictures dynamicly instead of everyone in the background like this.

#251094 by André R. on December 28th, 2006 [Permanent Link]

- History
Properties
Type Enhancement
Priority Medium
Component Misc
Affects Unknown
Fix Version -
Reporter André R.
Responsible -
Status 0 Closed
Resolution Won't Implement
Created April 5th, 2006
Updated December 28th, 2006
Resolved December 28th, 2006
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #019127
  DB Deadlocks on ezcontentobject_tree when updating subnode