What does this do?
This provides some more flexibility to the content type when editing a page. This is a modification of the default content type "Content" of CMSms. It provides much more flexibility by creating custom input controls in backend. Users can add dropdowns, multiple select lists, checkboxes, group content blocks in separate page tabs or block tabs inside a page tab by just using additional smarty params in the template when calling the content. It also adds ability to grant access of pages or just single content blocks 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. Also the content image function is extended to use the image manager or just an image dropdown. Page property of feu access and redirect page can be inherited by parent pages.
Note To get the full functionality of this content type you need to call your content with the module plugin {XContent}
It combines, among other things, the two tags {content} and {content_image}.
U 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.
How is it used?
Add the following params to your content tag in your page template, change the content type of your page to "XContent" and see what happens in backend...
What parameters are available?
all params are optional
-
(optional) block (string)
-
Allows you to have more than one content block per page. When multiple content tags are put on a template, that number of edit boxes will be displayed when the page is edited.
e.g.: {content block="Second Content block"}
Now, when you edit a page there will a textarea called "Second Content block".
Note The name of the content block may contain only spaces, letters, numbers, and underscores.
-
(optional) style (string)
-
set the inline style of the element in backend.
e.g.: make a note red with style='color:#FF0000;'
-
(optional) wysiwyg (boolean)
- If set to false, then a wysiwyg will never be used while editing this block. If true, then it acts as normal.
-
(optional) oneline (boolean)
- 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. Only works when parameter
type="text" is set.
-
(optional) type (text,file,image,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 set the tab in which the content block is displayed in the back end.
Possible values are "main" ( = Tab "Main Menu"), "options" ( = Tab "Options"), or any other arbitrary value, e.g. - You could add a checkbox to the options tab or create new tabs.
-
(optional) block_tab (string)
- With this parameter, the blocks of content within a tab can be further divided into tabs / are grouped together. Any expressioncan be used as a possible value.
-
(optional) label (string)
- Prompt for this content block. Possible values are any expression. If blank, the 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"}
Params of blocktype "checkbox":
-
(optional) checked (boolean)
- checks/unchecks the checkbox by default when editing a page
Params of blocktype "dropdown"/"select_multiple":
-
(optional) items (string)
- Item labe(s) of the field (separated by a comma)
-
(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) delimiter (string)
- A sign or string that will be used to devide the items/values (default is | (pipe))
-
(optional) selected (string)
- Preselected value(s) (separated by a comma)
- (optional) size (integer)
- Height of content block in back end if
type="select_multiple" is set. (Default is number of items)
Params of blocktype "image"/"file":
-
(optional) mode (string)
-
filepicker/dropdown
By default a "filepicker" will be used. Set to "dropdown" if user may not browse the files and a file dropdown will be displayed instead.
{content type="image" block="image1" mode="dropdown"}
-
(optional) dir (string)
-
The name of a directory (relative to the uploads directory [type="file"] or image uploads directory [type="image"], from which to select images/files. If not specified, the uploads/image uploads directory will be used.
E.g.: This will display the dir "myImages" in "uploads/images/".
{content type="image" block="image1" dir="myImages"}
E.g.: This will display the dir "myFiles" in "uploads/".
{content type="file" block="file1" dir="myFiles"}
-
(optional) show_subdirs (boolean)
-
Set to true if user may browse subdirectories. (only works with mode="filepicker")
E.g.: {content type="file" block="file1" show_subdirs="true"}
-
(optional) lock_input (boolean)
-
set to false if user may enter the file path in the file input (type="file" only)
-
(optional) class (string)
- The css class name to use on the img tag in frontend display. (type="image" only)
-
(optional) id (string)
- The id name to use on the img tag in frontend display. (type="image" only)
-
(optional) name (string)
- The tag name to use on the img tag in frontend display. (type="image" only)
-
(optional) width (integer)
- The desired width of the image. (type="image" only)
-
(optional) height (integer)
- The desired height of the image. (type="image" only)
-
(optional) alt (string)
- Alternative text if the image cannot be found. (type="image" only)
-
(optional) urlonly (boolean)
- Output only the url to the image, ignoring all parameters like id, name, width, height, etc. (type="image" only)
-
(optional) filter (string)
-
exclude or include files with the set perfix. (only works with mode="dropdown" at this time)
EX1: filter="exclude:thumb_" to knock out files containing thumb_
EX2: filter="include:thumb_" to include only files containing thumb_
-
(optional) file_extensions (string)
- A comma separated list of allowed file extensions of files to display (mode="dropdown" only)
-
(optional) allow_none (string)
- Set to true if the user may select "none" or clear the selected file/image value.
Params of blocktype "date":
-
(optional) step (int)
-
steps of minutes in the clock dropdown. (default is 30)
(optional) start_time (int)
-
the start time of the clock dropdown
(optional) end_time (int)
-
the end time of the clock dropdown
(optional) show24h (boolean)
-
set to false if AM/PM is used.
Other params:
-
(optional) redirect_page (not ready yet)
-
A page id or alias to redirect if user is not logged in or does not to belong to the specified group.
This will be overridden in backend.
That means param only defines the default value when a page is added.
Once a page is saved this param will have no effect anymore.
If the page to redirect to is the same like the current page no redirect will be processed
So if you select a redirect page that has also access to feu groups only the content will be replaced by feu login form or by just nothing. (Depends on param feu_action)
-
(optional) feu_access (not ready yet)
-
A list of feu group ids separated by a comma. This grants access only to certain feu groups.
This will be overridden in backend.
That means param only defines the default value when a page is added.
Once a page is saved this param will have no effect anymore.
-
(optional) feu_action (true/false) (not ready yet)
-
Specify if the login form of the feu module will be shown or not.
If set to false nothing will be shown.
This will be overridden in backend.
That means param only defines the default value when a page is added.
Once a page is saved this param will have no effect anymore.
-
(optional) block_only (true/false) (not ready yet)
-
Specify if only the current content block will be protected or not
If set to true only the current processed content block will be hidden if user is not logged in or does not belong to specified group(s)
(does not work with redirect_page)
-
(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" type="dropdown" items=":::global_content name='categorielist':::"}