SELF OverLib - eZ Publish JavaScript overLIB library integration

Tuesday, 24 June 2008, 11:44
Categories: Extensions
Tags: OverLib, JavaScript, integration, template operator

This extension integrates a popular OverLib JavaScript library with eZ Publish. Beside providing a simple template operator for automated generation of OverLib instances, it introduces a fallback configuration architecture for even easier and flexible use. It is possible to use pre-configurable presets, ad-hoc configurated calls as well as any combination of the two approaches.

Description

For each OverLib instance, a JavaScript code must be generated within HTML document that requires a number of paramter variables to be passed. Those variables control what text/content will be displayed, how the window will behave, what it will look like, will it be sticky, and so on. There are several problems with literally defining this JavaScript code in the templates:
- It is not easy to deal with special characters and escape strings, especially in the eZ template language,
- Static JavaScript code is not flexible in case of any future changes, especially across big projects.

To cope with those problems, a simple template operator is introduced. The operator automatically deals with any special chars that could destroy JavaScript code. It is also configurable by means of presets. Any number of presets can be defined and each preset can define any combination of OverLib settings.

To ensure that overlib gets always generated properly and the JavaScript has every variable required, a setting fallback system is introduced. The following priority is used to determine the values of OverLib parameters:
1) Ad-hoc declarations (within the template itself, when using the operator),
2) Preset declarations (if a preset was declared and used)
3) Default system values.
Any combination and order of parameters can be used.

Note: Please read the selfoverlib.ini configuration file for further details.
Note: Find out more about OverLib library at http://www.bosrup.com/web/overlib/

Examples

{* This is an adhoc declaration, it has no pre-configured settings, *}
{* all the paramters that are not declared will have default OverLib values. *}
{selfoverlib_display(
hash(
'content', 'THIS IS MY OVERLIB TEXT',
'caption', 'THIS IS MY OVERLIB CAPTION',
'html_value', 'THIS IS THE ANCHOR',
'width', '225',
)
)}
{* This is a preset-based declaration. You do not have to define anything *}
{* except for the preset and the content. *}
{selfoverlib_display(
hash(
'preset', 'admindefault',
'caption', 'Help: how to use it?',
'content', 'It order to use this functionality, you must...',
)
)}

Read doc/readme.txt for further details.

This extension is available at:
http://ez.no/developer/contribs/template_plugins/self_overlib

Comments

  • Martin julie
    Tuesday, 7 July 2009, 16:11

    test king

    I am searching for advanced and latest features or information about <a href="http://www.testking-certified.com">test king</a>. I want to thank you that you have done really a great job. I am also waiting for your latest posts and information about various topics. Thanks a lot.
  • sherry william
    Wednesday, 7 April 2010, 12:18

    JavaScript

    JavaScript is an object-oriented scripting language used to enable programmatic access to computational objects within a host environment. Although also used in other applications, it is primarily used in the form of client-side JavaScript, implemented as part of a web browser, providing enhanced user interfaces and dynamic websites. JavaScript is a dialect of the ECMAScript standard and is characterized as a dynamic, weakly typed, prototype-based language with first-class functions. JavaScript was influenced by many languages and was designed to look like Java, but to be easier for non-programmers to work with. JavaScript was originally developed by Brendan Eich of Netscape under the name Mocha, which was later renamed to LiveScript, and finally to JavaScript. The change of name from LiveScript to JavaScript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator web browser. JavaScript was first introduced and deployed in the Netscape browser version 2.0B3 in December 1995. The naming has caused confusion, giving the impression that the language is a spin-off of Java, and it has been characterized by many as a marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new web-programming language.
  • mary tina
    Wednesday, 14 December 2011, 08:29

    Kvinder Moncler dynejakker

    This is the coolest website and stories that i have ever read…<a href="http://www.moncler-butikken.net">Kvinder Moncler dynejakker</a>its useful for me as im a lecturer and always motivate my students with these publised stories…<a href="http://www.moncler-butikken.net">Kvinder Moncler Ned Frakker</a>thank you …<a href="http://www.moncler-butikken.net">Mænd Moncler dynejakker</a>and waiting for plenty more…
  • Evangeline Selden
    Wednesday, 5 March 2014, 03:48

    http://www.michaelkorshandbagsuk.org.uk/


    <a href="http://www.michaelkorshandbagsuk.org.uk/">Michael Kors Handbags UK</a>,Michael Kors Handbags
Log in or register to add a comment