widgets - Describe implementation of widgets within Extenso
Widget are based on the following tables:
For each widget, a table for the content might be connected in the sn_widgets table.
Widgets are usually put in 2 places:
If a widget is connected with a table, then when we edit this widget we can publish this table.
The publish of the widget will then be placed in /publish/table_name.sn
This publish can use the following publish:
use cgidata; use user; use config; use state; use page; %include "/extenso/functions/sn_publish.snc"; site_config = sql("select * from sn_configs"); elems = splitre(value:state.sn_path,re:":"); if state.sn_modal eq "t" && isdigit(elems[1]) && elems[0] eq "uid_widget" then widget = sql(single:true,"select * from sn_widgets_list where uid = '?'", elems[1]); res = sn_publish(widget.rows.table_name,widget.rows.uid_page,config.site); ... else ct(ct:"sn_ct",code:"Can't publish this widget %s", state.sn_path); endif
In the implementation of a widget the following variables can be use:
So an actual implementation might be:
for parten sql("select * from widget_slider_homepage where actif = 'oui' and uid_widget = '?' order by sn_custom", widget.rows.uid_widget_list) do ... endfor
Written by Pierre Laplante
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
1.0 2014-09-09 21:24:14 laplante@sednove.com