Make sure CMS_BLOCK knows about page variables values.
For now only for smarty template blocks.
This commit is contained in:
@@ -921,13 +921,19 @@ feature -- Generation
|
|||||||
across
|
across
|
||||||
reg_ic.item.blocks as ic
|
reg_ic.item.blocks as ic
|
||||||
loop
|
loop
|
||||||
-- if attached {CMS_SMARTY_CONTENT_BLOCK} ic.item as l_tpl_block then
|
if attached {CMS_SMARTY_TEMPLATE_BLOCK} ic.item as l_tpl_block then
|
||||||
-- across
|
-- Apply page variables to smarty block.
|
||||||
-- page.variables as var_ic
|
-- FIXME: maybe add notion of values at the CMS_BLOCK level
|
||||||
-- loop
|
-- or consider a CMS_BLOCK_WITH_VALUES ...
|
||||||
-- l_tpl_block.set_value (var_ic.item, var_ic.key)
|
across
|
||||||
-- end
|
page.variables as var_ic
|
||||||
-- end
|
loop
|
||||||
|
if not l_tpl_block.values.has (var_ic.key) then
|
||||||
|
-- Do not overwrite if has key.
|
||||||
|
l_tpl_block.set_value (var_ic.item, var_ic.key)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
page.add_to_region (theme.block_html (ic.item), reg_ic.item.name)
|
page.add_to_region (theme.block_html (ic.item), reg_ic.item.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user