What does this do?
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
params in the template when calling the content.
It also adds ability to grant access of pages or just single content blocks (not ready yet) 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 combined with the content tag and extended to use a filepicker or just an image dropdown.
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}
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.
How is it used?
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) 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 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
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) 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 (true/false)
-
A comma separated list of group names that are allowed to edit this block.
-
(optional) editor_users (true/false)
-
A comma separated list of user names that are allowed to edit this block.
Notice: 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 (string)
- 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" type="dropdown" items=":::global_content name='categorylist':::"}
Params of blocktype "checkbox":
-
(optional) checked (true/false)
-
checks/unchecks the checkbox by default when adding a page
Note: This param is deprecated. Use the param "default" instead. Use "1" for checked and "0" for unchecked
E.g. {content 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) selected (string)
-
Preselected value(s) (separated by a delimiter - default is | (pipe))
Note: This param is deprecated. Use the param "default" instead.
-
(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
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
Params of blocktype "image"/"file":
-
(optional) mode (filepicker/dropdown)
-
By default a dropdown will be used. Set to "filepicker" if user may browse the files.
{content type="image" block="image1" mode="filepicker"}
-
(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 (true/false)
-
Set to true if user may browse subdirectories. (mode="filepicker" only)
E.g.: {content type="file" block="file1" show_subdirs="true"}
Note: This param will be ignored if the user belongs to the admin group.
-
(optional) upload (true/false)
-
Set to true if user may upload files.
Note: By default this param depends on the user permission "Modify Files". That means this param will be ignored if user has permission to modify files.
It is only meant to allow upload to users without permission "Modify Files".
-
(optional) lock_input (true/false)
-
set to false if user may enter the file path in the file input (type="file" only)
Note: This param will be ignored if the user belongs to the admin group.
-
(optional) class (string)
- The css class attribute to use on the img tag (type=image) / link (type=file) in frontend display.
-
(optional) id (string)
- The id attribute to use on the img tag (type=image) / link (type=file) in frontend display.
-
(optional) name (string)
- The name attribute to use on the img tag (type=image) / link (type=file) in frontend display.
-
(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)
- The alternative text if the image cannot be found. (type="image" only)
-
(optional) title (string)
- The title text to use on the img tag (type=image) / link (type=file) in frontend display.
-
(optional) urlonly (true/false)
- Output only the url to the image/file, ignoring all parameters like id, name, width, height, etc.
-
(optional) filter (string)
-
A comma separated list of prefixes to exclude or include files with the set prefix.
E.g.:
filter="exclude:thumb_" to knock out files containing thumb_
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 (excluding the dot)
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 (show24h = false) 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)
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.