What does this do?
This is a modification of the default content type "Content" of CMSms.
It provides more flexibility by creating custom input controls in backend.
Users can add dropdowns, multiple select lists, checkboxes, group content blocks
in separate page tabs, block tabs inside a page tab or in fieldsets by just
using additional params in the template when calling the content.
It also adds ability to grant access of pages to certain users of the
FrontEndUsers module and hide the content, replace it by the login form of the
FrontEndUsers module or redirect to a specified page showing the login form or
just redirect without doing anything else.
Page property of FrontEndUsers access and redirect page can be inherited by
parent pages.
Note: To get the full functionality of this content type
in frontend you need to call your content with the module plugin {AdvancedContent}
(case sensitive!).
Otherwise it may behave like the default content type plugin.
You can even use smarty logic in parameter values. That means you can use the
result of a plugin, an udt or even a module or just the content of a global
content block as parameter value to create dynamic values.
How is it used?
After installation the module settings can be found in "Extensions->AdvancedContent".
Additionally you will have a new content type "AdvancedContent" available
when adding/editing a page.
Add the following params to your content tag in your page template,
change the content type of your page to "AdvancedContent" and see what happens
in backend...
What parameters are available?
all params are optional
Default params:
-
(optional) block (string)
-
Allows you to have more than one content block per page. If multiple content tags are put on a template, that number of edit boxes will be displayed if the page is edited.
e.g.: {content block="Second Content block"}
Now, if you edit a page there will ba a textarea called "Second Content block".
Note: The name of the content block may contain only letters, numbers, and underscores (no whitespaces, special chars, umlauts etc.). Otherwise it will be converted to a proper name (similar to the page alias).
-
(optional) wysiwyg (true/false)
- If set to false, then a wysiwyg will never be used while editing this block. If true, then it acts as normal.
-
(optional) oneline (true/false)
- If set to true, then only one edit line will be shown while editing this block. If false, then it acts as normal. Only works when block parameter is used.
-
(optional) default (string)
- Default content when creating a new page.
-
(optional) label (string)
- Prompt for this content block. Possible values are any expression. If blank, the unconverted block name is used.
-
(optional) assign (string)
-
Assigns the content to a smarty parameter, which you can then use in other areas of the page, or use to test whether content exists in it or not.
Example of passing page content to a User Defined Tag as a parameter:
{content assign=pagecontent}
{table_of_contents thepagecontent="$pagecontent"}
Note: For some reason this param does not work at the moment with the module plugin {AvancedContent}. Use
{capture assign="foo"}{AdvancedContent}{/capture}
instead.
Advanced params:
-
(optional) block_type (text,checkbox,dropdown,select_multiple,date)
- Allows you to specify what content control type is used in the back end. Supports block-parameters to include additional options.
-
(optional) page_tab (string)
-
This parameter sets the tab in which the content block is displayed in the backend.
Possible values are "main" ( = Tab "Main Menu"), "options" ( = Tab "Options"), or any other arbitrary value
e.g. you can add a checkbox to the options tab or create new tabs.
-
(optional) block_tab (string)
- With this parameter, the blocks within a page tab can be further divided into tabs or can be grouped together. Any expression can be used as a possible value.
-
(optional) block_group (string)
- With this parameter, multiple blocks can be grouped in a fieldset. Any expression can be used as a possible value.
-
(optional) active (true/false)
-
Allows you to disable a content block. Disabled content blocks won't be shown in backend as well as in frontend. (only works with {AdvancedContent} plugin)
-
(optional) style (string)
-
set the inline style of the element in backend.
e.g.: make a note red with style='color:#FF0000;'
-
(optional) editor_groups (string)
-
A comma separated list of group names that are allowed to edit this block.
-
(optional) editor_users (string)
-
A comma separated list of user names that are allowed to edit this block.
Note: if the params editor_users and editor_groups are empty the block may be edited by any user with sufficient permission to edit a page
-
(optional) feu_access (not ready yet)
-
A list of feu groups separated by a comma.
This grants access to this content block only to certain feu groups.
-
(optional) feu_action (true/false) (not ready yet)
-
Specify if the login form of the feu module will be shown or not.
-
(optional) allow_none (true/false)
- Set to true if the user may enter empty values.
If set to false and value is empty the default value of the param "default" will be used.
If set to true and block is of type image/file the option "none" (mode="dropdown") or a button to clear the selected file/image value (mode="filepicker") will be displayed.
-
(optional) smarty (true/false)
-
Turn smarty processing of values on/off.
If set to true any given value will be processed by the smarty engine.
Note: Notice that you cannot use the default smarty delimiters that are used in the template. This will cause smarty errors in frontend.
So you need to use ::: as delimiter instead.
E.g.: {content block="Categories" label="Select a category" block_type="dropdown" items=":::global_content name='categorylist':::" smarty="true"}
-
(optional) description (string)
- Allows you to add a detailed description to that block for your editors.
Params of blocktype "checkbox":
-
(optional) default (true/false)
-
checks/unchecks the checkbox by default when adding a page
Note: Use "1" for checked and "0" for unchecked by default
E.g. {content block_type="checkbox" default=1}
Params of blocktype "dropdown"/"select_multiple":
-
(optional) items (string)
- Item label(s) of the field(s) (separated by a delimiter - default is | (pipe))
-
(optional) values (string)
- Value(s) of the items (separated by a delimiter - default is | (pipe))
Notice: if there are less values than items the item labels will be used as values (and vise versa).
-
(optional) default (string)
-
Preselected value(s) (separated by a delimiter - default is | (pipe))
-
(optional) delimiter (string)
- A sign or string that will be used to devide the items/values (default is | (pipe))
- (optional) size (integer)
- Height of content block in back end if
block_type="select_multiple" is set. (Default is number of items)
- (optional) sortable_items (true/false) - select_multiple only
-
If set to true the items won't be shown as a multiple select input with options but as a list of checkboxes that can be reordered.
Each row contains the item label and a checkbox with the item value.
Note: only the order of the selected items will be stored and always displayed on the top of the list when reloading the edit page.
Unselected items will appended in that order they are defined in the template
-
(optional) collapse (true/false)
-
The default display of the block in backend.
Params of blocktype "date":
-
(optional) step_hours (int)
-
steps of hours in the clock dropdown. (default is 1)
-
(optional) start_hour (int)
-
the start hour of the clock dropdown. (default is 0)
-
(optional) end_hour (int)
-
the end hour of the clock dropdown (default is 12 or 23)
-
(optional) show24h (true/false)
-
set to false if AM/PM is used. (default is true)
-
(optional) step_minutes (int)
-
steps of minutes in the clock dropdown. (default is 10)
-
(optional) start_minute (int)
-
the start minute of the clock dropdown. (default is 0)
(optional) end_minute (int)
-
the end minute of the clock dropdown (default is 59)
-
(optional) show_clock (true/false)
-
set to false if no time dropdown should be displayed (default is true)
Note: If set to false 00:00 o'clock will be used
-
(optional) date_format (string)
-
The strftime date format to show in frontend.
Support
This module does not include commercial support. However, there are a number of resources available to help you with it:
Please report any kind of feedback.
Copyright and License
As per the GPL, this software is provided as-is.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Or read it online: http://www.gnu.org/licenses/licenses.html#GPL
Please read the text of the license for the full disclaimer.
Copyright © 2010, Georg Busch (NaN). All Rights Are Reserved.
This module has been released under the GNU Public License. You must agree to this license before using the module.