Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dev:changes_in_2.6 [2013/12/23 11:04]
mistic100
dev:changes_in_2.6 [2014/03/16 08:07] (current)
plg is_adviser() removed
Line 270: Line 270:
  
 ===== CSS & JS as Smarty templates ===== ===== CSS & JS as Smarty templates =====
-TODO+Starting from Piwigo 2.6 you can add Smarty (templating) code in your CSS and JS files included with **combine_css** and **combine_script**.
  
 +=== Usage ===
 +Add //template=true// in the file declaration.
 +<code>
 +{combine_script id='myscript' path='path/to/dynamic.js' template=true}
 +{combine_css id='mystyle' path='path/to/dynamic.css' template=true}
 +</code>
 +
 +The template engine will first parse the file as a common template file then send it to the file combiner which merges all CSS and JS files in two single files.
 +
 +=== Limitation ===
 +The CSS and JS template files are only parsed when the file combiner needs to regenerate the combined files. This means you can not use real dynamic values in those files.\\
 +This feature must only be used for CSS and JS files depending on a configuration param, chaging very rarely.\\
 +When the said configuration changes you must notify the template engine. There are two ways to do that:
 +  * clear all combined files by calling
 +<code>FileCombiner::clear_combined_files();</code>
 +  * use the //version// parameter of **combine_css** and **combine_script**. For example, EasyCaptcha plugin saves the timestamp of last change in his configuration and uses it as CSS version.
 +<code>{combine_css id='mystyle' path='path/to/dynamic.css' template=true version=$lastmod}</code>
 ===== query2array ===== ===== query2array =====
 Piwigo 2.6 introducs a new helper. **query2array** builds an array from a SQL query, it actually combines the possibilities of **hash_from_query**, **simple_hash_from_query**, **array_from_query**. Piwigo 2.6 introducs a new helper. **query2array** builds an array from a SQL query, it actually combines the possibilities of **hash_from_query**, **simple_hash_from_query**, **array_from_query**.
Line 308: Line 325:
 </code> </code>
  
 +===== is_adviser() removed =====
 +
 +Function is_adviser() has been deprecated for several releases. Now it has been removed. If you keep it your code, Piwigo will crash.
 
Back to top
dev/changes_in_2.6.1387796680.txt.gz · Last modified: 2013/12/23 11:04 by mistic100
 
 
github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact