Improved block condition "path:..." by allowing wildchar.
Added weight data to CMS_BLOCK to be able to sort the block lists,
and thus order the display of blocks.
Set negative weight for various core block, so that they appear first as expected.
The weight can be set and overwritten in cms.ini , by pref blocks.{block_id}.weight=integer_weight.
This commit is contained in:
@@ -6,7 +6,12 @@ deferred class
|
||||
CMS_BLOCK
|
||||
|
||||
inherit
|
||||
COMPARABLE
|
||||
|
||||
DEBUG_OUTPUT
|
||||
undefine
|
||||
is_equal
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
@@ -23,6 +28,10 @@ feature -- Access
|
||||
html_options: detachable CMS_HTML_OPTIONS
|
||||
-- Optional addition html options.
|
||||
|
||||
weight: INTEGER
|
||||
-- Weight used to order blocks.
|
||||
-- Default: 0;
|
||||
|
||||
feature -- Status report
|
||||
|
||||
is_empty: BOOLEAN
|
||||
@@ -42,6 +51,14 @@ feature -- Status report
|
||||
conditions: detachable LIST [CMS_BLOCK_CONDITION]
|
||||
-- Optional block condition to be enabled.
|
||||
|
||||
feature -- Comparison
|
||||
|
||||
is_less alias "<" (other: like Current): BOOLEAN
|
||||
-- <Precursor>.
|
||||
do
|
||||
Result := weight < other.weight
|
||||
end
|
||||
|
||||
feature -- Element change
|
||||
|
||||
add_css_class (a_class: READABLE_STRING_8)
|
||||
@@ -83,6 +100,12 @@ feature -- Element change
|
||||
l_conditions.force (a_condition)
|
||||
end
|
||||
|
||||
set_weight (w: like weight)
|
||||
-- Set `weight' to `w'.
|
||||
do
|
||||
weight := w
|
||||
end
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
to_html (a_theme: CMS_THEME): STRING_8
|
||||
|
||||
Reference in New Issue
Block a user