Skip to content

Instantly share code, notes, and snippets.

@hertsch
Last active January 1, 2016 13:08
Show Gist options
  • Save hertsch/8148890 to your computer and use it in GitHub Desktop.
Save hertsch/8148890 to your computer and use it in GitHub Desktop.
The helpfile for the kitCommand flexContent

##~~ flexContent ~~

With the kitCommand ~~ flexContent ~~ you can embed flexContent articles, categories, hashtags or FAQ's in any WYSIWYG section of your Content Management System.

Introduction

With the parameter action[] you tell flexContent which action you want to perform, so action[] is always needed and you should have a closer look to it.

Most of the parameters documented in this helpfile are used to override the general configuration of flexContent.

Parameters

Please be aware that these are only the additional parameters for ~~ flexContent ~~, there exists also parameters for the general usage with the kitCommands.

Main parameters for flexContent:

Parameters used in context with action[]:

Optional parameters to override the flexContent configuration:

Parameters used in the context with the kitCommand ~~ action[tag] type[listing] ~~:

Parameters used in the context with the kitCommand ~~ action[tag] type[listing] mode[cloud] ~~:

action[]

The parameter action[] is general needed and used to tell flexContent which action should be performed.

Following action values are supported by action[]:

  • action[archive] - show all archived articles as list. ~~ flexcontent action[archive] ~~ is a short hand action command and identical to the kitCommand ~~ flexcontent action[list] content_status[ARCHIVED] ~~
  • action[category] - show all articles assigned to the flexContent category with the category_id submitted by the parameter category_id[]
  • action[faq] - show articles in a FAQ Style, the title of the articles are the questions and the teasers or the contents are the answers. You can specify a category with category_id[] in this case the list will be generated from all articles of the category and sorted ascending by the titles. You can also specify selected content ID's using the parameter faq_ids[], in this case the sequence is also the order of the questions.
  • action[info] - if also the parameter remote[] is set, flexContent will try to retrieve and show information about the categories which are available at the remote Server for the specified connection.
  • action[tag] - show all articles tagged with the #hashtag ID submitted by the parameter tag_id[] - in combination with the paramter type[] you can create #hashtag list or #hashtag clouds
  • action[list] - show exposed and actual teasers form all categories in list. Select specified categories with the parameter categories[] or exclude specified categories with the parameter categories_exclude[].
  • action[view] - show the flexContent article with the content_id submitted by the parameter content_id[]

Examples:

~~ flexContent action[view] content_id[17] ~~

will show the flexContent the article with the content_id 17.

~~ flexContent action[category] category_id[4] ~~

will show all flexContent articles belonging to the category with the ID 4.

~~ flexContent action[tag] tag_id[21] ~~

will show all flexContent articles tagged with the #hashtag ID 21.

~~ flexContent action[list] categories_exclude[13,9] ~~

will show a list with all exposed and actual teasers from all categories but not from the categories with the ID 13 and the ID 9

~~ flexContent action[list] type[simple] categories[2,4] content_limit[12] ~~

will show a simple list with a maximum of 12 exposed and actual teasers from the categories ID 2 and ID 4

~~ flexContent action[faq] category[5] ~~

will generate a FAQ sheet from the category with the ID 5

~~ flexContent action[faq] faq_ids[7,11,3,8,5,12] ~~

will generate a FAQ sheet from the contents with the ID's 7, 11, 3, 8, 5 and ID 12

categories[]

Specify the categories which should be processed. Separate the numbers with a comma. This parameter is used by action[list].

Example:

~~ flexContent action[list] categories[2,4] ~~

categories_exclude[]

Specify the categories which should not processed. Separate the numbers with a comma. This parameter is used by action[list].

Example:

~~ flexContent action[list] categories_exclude[2,4] ~~

category_description[]

Depending on the action[] context flexContent will show or show not the description of the associated category

  • show the category description with category_description[1] or category_description[true]
  • suppress the category description with category_description[0] or category_description[false]

Example:

~~ flexContent action[category] category_id[2] category_description[false] ~~   

will not show the category description.

category_id[]

Specify the ID of the flexContent category which should be processed. This parameter is used by action[category] and action[faq].

Example:

~~ flexContent action[faq] category_id[2] ~~ 

category_image[]

Depending on the action[] context flexContent will show or show not the image which is associated to the category.

  • show the category image with category_image[1] or category_image[true]
  • suppress the category name with category_image[0] or category_image[false]

Example:

~~ flexContent action[category] category_id[2] category_image[false] ~~   

will not show the category image.

category_image_max_height[]

You can set the maximum height in pixels of the image associated to the category.

Example:

~~ flexContent action[category] category_id[2] category_image_max_height[200] ~~

set the image to a maximum height of 200 pixels.

category_image_max_width[]

You can set the maximum width in pixels of the image associated to the category.

Example:

~~ flexContent action[category] category_id[2] category_image_max_width[200] ~~

set the image to a maximum width of 200 pixels.

category_name[]

Depending on the action[] context flexContent will show or show not the name of the associated category

  • show the category name with category_name[1] or category_name[true]
  • suppress the category name with category_name[0] or category_name[false]

Example:

~~ flexContent action[category] category_id[2] category_name[false] ~~   

will not show the category name.

load_jquery[]

You can suppress the autoloading of jQuery files from the library:

Example:

~~ flexContent action[list] load_jquery[false] ~~

color_background[]

This parameter is used to define the background color of the #hashtag cloud:

~~ flexContent action[tag] type[listing] mode[cloud] color_background[#ccff33] ~~

will use the color #ccff33 for the canvas background.

You can specify colors as hexadecimal value, like color_background[b#ccff33] or as RGB value, like color_background[204,255,51] or RGBA value with transparency like color_background[204,255,51,0.3]

color_end[]

The parameter color_end[] is used in context with the parameter color_mode[gradient] to define the ending color of the gradient:

~~ flexContent action[tag] type[listing] mode[cloud] color_mode[gradient] color_end[#000] ~~

will set #000 (black) as ending color for the gradient.

You can specify colors as hexadecimal value, like color_end[b#ccff33] or as RGB value, like color_end[204,255,51].

color_option[]

If you are using the #hashtag cloud you can use the parameter color_option[] to define the type of color selection for the different #hashtags, possible are:

  • color_option[gradient] - will use color_start[] and color_end[] and select the color for all #hashtags from start to end as gradient

  • color_option[random-dark] - (default) will select the color for the different #hashtags by random, using mor dark colors

  • `color_option[random-light] - will select the color for the different #hashtags by random, using more light colors

    ~~ flexContent action[tag] type[listing] mode[cloud] color_option[random-light] ~~

will use light randomized colors for the cloud.

color_start[]

The parameter color_start[] is used in context with the parameter color_mode[gradient] to define the starting color of the gradient:

~~ flexContent action[tag] type[listing] mode[cloud] color_mode[gradient] color_start[#ffcc00] ~~

will set #ffcc00 as starting color for the gradient.

You can specify colors as hexadecimal value, like color_start[#ccff33] or as RGB value, like color_start[204,255,51].

content_author[]

Depending on the action[] context flexContent will show or show not the author of the content.

  • show the author with content_author[1] or content_author[true]
  • suppress the categories with content_author[0] or content_author[false]

Example:

~~ flexContent action[view] content[2] content_author[false] ~~   

will not show the author below the article.

content_categories[]

Depending on the action[] context flexContent will show or show not the categories assigned to the content.

  • show the categories with content_categories[1] or content_categories[true]
  • suppress the categories with content_categories[0] or content_categories[false]

Example:

~~ flexContent action[view] content[2] content_categories[false] ~~   

will suppress the categories.

content_comments[]

Depending on the action[] context flexContent will show or show not the commenting feature for the visitors.

  • show the comments with content_comments[1] or content_comments[true]
  • suppress the comments with content_comments[0] or content_comments[false]

Example:

~~ flexContent action[view] content[2] content_comments[false] ~~   

will switch off the comments.

content_control[]

Switch off the content control bar with links to the previous and next article and to the category of the article using content_control[]:

~~ flexContent action[view] content[2] content_control[0] ~~

or

~~ flexContent action[view] content[2] content_control[false] ~~

content_date[]

Depending on the action[] context flexContent will show or show not the date when the content was published.

  • show the date with content_date[1] or content_date[true]
  • suppress the categories with content_date[0] or content_date[false]

Example:

~~ flexContent action[view] content[2] content_date[false] ~~   

will not show the date below the article.

content_description[]

Show also the description of a content:

~~ flexContent action[view] content[2] content_description[1] ~~

or

~~ flexContent action[view] content[2] content_title[true] ~~

content_exclude[]

You can exclude specific content ID's from categories, tags and general lists using the parameter content_exclude[]:

~~ flexContent action[category] category_id[5] content_exclude[8,13] ~~

will show all contents from the category with the ID 5 but not articles with the content ID 8 or 13.

content_id[]

Specify the ID of the flexContent article which should be shown. This parameter is used by action[view].

Example:

~~ flexContent action[view] content_id[17] ~~

content_image[]

Depending on the action[] context flexContent will show or show not the image which is associated to the content.

  • show the content image with content_image[1] or content_image[true]
  • suppress the category name with content_image[0] or content_image[false]

Example:

~~ flexContent action[category] category_id[2] content_image[false] ~~   

will not show the content image(s).

content_image_max_height[]

You can set the maximum height in pixels of the image associated to the content.

Example:

~~ flexContent action[category] category_id[2] content_image_max_height[200] ~~

set the image to a maximum height of 200 pixels.

content_image_max_width[]

You can set the maximum width in pixels of the image associated to the content.

Example:

~~ flexContent action[category] category_id[2] content_image_max_width[200] ~~

set the image to a maximum width of 200 pixels.

content_image_small_max_height[]

You can set the maximum height in pixels of the smaller image associated to the content.

Example:

~~ flexContent action[category] category_id[2] content_image_small_max_height[100] ~~

set the image to a maximum height of 100 pixels.

content_image_small_max_width[]

You can set the maximum width in pixels of the smaller image associated to the content.

Example:

~~ flexContent action[category] category_id[2] content_image_small_max_width[100] ~~

set the image to a maximum width of 100 pixels.

content_limit[]

Limit the number of contents processed in a action. This parameter is used by by action[list].

Example:

~~ flexContent action[list] content_limit[12] ~~

content_permalink[]

Show or show not the permanent link to the content.

  • show the permanent link with content_permalink[1] or content_permalink[true]
  • suppress the permanent link with content_permalink[0] or content_permalink[false]

Example:

~~ flexContent action[view] content[2] content_permalink[false] ~~   

will suppress the permanent link.

content_rating[]

Depending on the action[] context flexContent will show or show not the rating feature for the visitors.

  • show the rating with content_rating[1] or content_rating[true]
  • suppress the rating with content_rating[0] or content_rating[false]

Example:

~~ flexContent action[view] content[2] content_rating[false] ~~   

will switch off the rating.

content_status[]

Allow to specify the status of the contents which are to process. You can set multiple values, possible are:

  • UNPUBLISHED
  • PUBLISHED
  • BREAKING
  • HIDDEN
  • ARCHIVED
  • DELETED

separate multiple values by comma, example:

~~ flexContent action[category] category_id[9] content_status[PUBLISHED,BREAKING,HIDDEN] ~~

will process all published, breaking and hidden contents of the category with the ID 9

content_tags[]

Depending on the action[] context flexContent will show or show not the #hashtags assigned to the content (this are not the #hashtags within the content articles!).

  • show the #hashtags with content_tags[1] or content_tags[true]
  • suppress the #hashtags with content_tags[0] or content_tags[false]

Example:

~~ flexContent action[view] content[2] content_tags[false] ~~   

will suppress the #hashtags.

content_title[]

Don't show the title of a content:

~~ flexContent action[view] content[2] content_title[0] ~~

or

~~ flexContent action[view] content[2] content_title[false] ~~

content_view[]

Depending on the selected action[] flexContent will show the content (full text) or the teaser (short text) of an article, with content_view[] you can change the default behavior:

~~ flexContent action[view] content[2] content_view[teaser] ~~

will show the teaser instead of the content

~~ flexContent action[tag] category_id[9] content_view[content] ~~

will show the content instead of the teaser

faq_comments[]

Depending on the action[faq] context flexContent will show or show not the commenting feature for the visitors.

  • show the comments with faq_comments[1] or faq_comments[true]
  • suppress the comments with faq_comments[0] or faq_comments[false]

Example:

~~ flexContent action[faq] category_id[2] faq_comments[false] ~~   

will switch off the comments.

faq_control[]

Switch off the FAQ control bar with links to the previous and next article and to the category of the article using faq_control[]:

~~ flexContent action[faq] category_id[2] faq_control[0] ~~

or

~~ flexContent action[faq] category_id[2] faq_control[false] ~~

faq_permalink[]

Show or show not the permanent link to the FAQ.

  • show the permanent link with faq_permalink[1] or faq_permalink[true]
  • suppress the permanent link with faq_permalink[0] or faq_permalink[false]

Example:

~~ flexContent action[faq] category_id[2] faq_permalink[false] ~~   

will suppress the permanent link.

faq_rating[]

Depending on the action[faq] FAQ context flexContent will show or show not the rating feature for the visitors.

  • show the rating with faq_rating[1] or faq_rating[true]
  • suppress the rating with faq_rating[0] or faq_rating[false]

Example:

~~ flexContent action[faq] category_id[2] faq_rating[false] ~~   

will switch off the rating.

height[]

The parameter height[] can be used in context with

~~ flexContent action[tag] type[listing] mode[cloud] height[300] ~~

to specify the height in pixel for the cloud canvas container. By default the canvas height will be set to 400 pixel.

hide_if_empty[]

If you don't want that flexContent prompt an alert if no content is available for the desired action, set the parameter hide_if_empty[] without any value:

~~ flexContent action[list] categories[3,6] hide_if_empty[] ~~

if the list is empty, flexContent will return an empty result (absolute nothing).

hide_if_empty[] can be used with action[category], action[faq], action[list] and action[tag].

limit[]

The parameter limit[] can be used to limit the number of returned results of a query.

For example, limit[] can be used in context with the kitCommand:

~~ flexContent action[faq] type[listing] limit[10] ~~

this will return only the first 10 #hashtags as tiny list.

load_css[]

By default the flexContent kitCommand will dynamically load a flexcontent.css and initialize some needed jQuery files. If you want to switch off the CSS and jQuery loading you can use the parameter load_css[] with the value 0 or false:

~~ flexContent action[view] content[2] load_css[0] ~~

or

~~ flexContent action[view] content[2] load_css[false] ~~

order_by[]

Specify the field to order by database queries - you must know the correct field name to use this parameter!

Example:

~~ flexContent action[list] order_by[title] ~~

will order the resulting list by the field title instead of publish_from (default).

In context with the kitCommand

~~ flexContent action[tag] type[listing] order_by[tag_name] ~~

the fields used by order_by[] can be:

  • order_by[tag_id] - will order the #hashtags by their ID (the oldest tag will have the lowest ID)
  • order_by[tag_name] - will order the #hashtags by their unique name
  • order_by[tag_count] - (default) will order the #hastags depending on the count how often they are referenced in flexContent articles

order_direction[]

Change the order direction of database queries, possible values are ASC (Ascending) or DESC (Descending):

~~ flexContent action[list] order_direction[ASC] ~~

or

~~ flexContent action[list] order_direction[DESC] ~~

mode[]

This parameter can be used in contect with the parameter action[tag] and the parameter type[listing] to tell flexContent to generate a cloud of hashtags:

~~ flexContent action[tag] type[listing] mode[cloud] ~~

will generate a cloud of vertical and horizontal hashtags in different sizes (depending on the number how often a #hashtag is referenced) and colors. Try it!

paging[]

A paging is supported for the action[list] commands. By default paging[] is off. You can set paging to the number of articles which will be shown in the list, i.e.:

~~ flexContent action[list] paging[5] ~~

will show 5 articles and insert buttons to step to the next or previous page of the list.

SEO: using paging[] will automatically set the meta tag

<meta name="robots" content="noindex,follow">

for any subpage to avoid indexing a duplicate content.

rotation_ratio[]

The parameter rotation_ratio[] can be used in context with

~~ flexContent action[tag] type[listing] mode[cloud] rotation_ratio[0.1] ~~

to define the ratio between horizontal and vertical aligned #hashtags. The ratio must be a float value between 0.0 (all words will be aligned horizontal) and 1.0 (all words will be aligned vertical). The default ratio is 0.3.

size_factor[]

The parameter size_factor[] can be used in context with

~~ flexContent action[tag] type[listing] mode[cloud] size_factor[2] ~~

to define a factor by which the #hashtag words will be increased. By default the size_factor[] is 0 - the #hashtag words will be increased automatically.

size_grid[]

The parameter size_grid[] can be used in context with

~~ flexContent action[tag] type[listing] mode[cloud] size_grid[16] ~~

to define the distance between the #hashtag words. By default size_grid[] is set to 8.

sort[]

The parameter size_factor[] can be used in context with

~~ flexContent action[tag] type[listing] mode[cloud] sort[random] ~~

to tell the cloud the sorting mode:

  • sort[highest] - (default) the cloud start with the highest rated #hashtag and step down to the lowest
  • sort[lowest] - the cloud start with the lowest rated #hashtag and step down to the highest
  • sort[random] - the #hashtags will be sorted by random

tag_description[]

Depending on the action[] context flexContent will show or show not the description of the associated #hashtag

  • show the #hashtag description with tag_description[1] or tag_description[true]
  • suppress the #hashtag description with tag_description[0] or tag_description[false]

Example:

~~ flexContent action[tag] tag_id[2] tag_description[false] ~~   

will not show the #hashtag description.

tag_id[]

Specify the ID of the #hashtag which should be processed. This parameter is used by action[tag].

Example:

~~ flexContent action[tag] tag_id[32] ~~

tag_ids[]

The parameter tag_ids[] can be used in context with

~~ flexContent action[tag] type[listing] tag_ids[7,3,18,16,42,23] ~~

to specify explicit tag ID's which should be used for the list.

You can list as many tag ID's as you want, separate them by comma.

If you want to list the tag ID's in the given order use the parameter order_by[null]:

~~ flexContent action[tag] type[listing] tag_ids[7,3,18,16,42,23] order_by[null] ~~

tag_image[]

Depending on the action[] context flexContent will show or show not the image which is associated to the #hashtag.

  • show the #hashtag image with tag_image[1] or tag_image[true]
  • suppress the #hashtag name with tag_image[0] or tag_image[false]

Example:

~~ flexContent action[tag] tag_id[2] tag_image[false] ~~   

will not show the #hashtag image.

tag_image_max_height[]

You can set the maximum height in pixels of the image associated to the #hashtag.

Example:

~~ flexContent action[tag] tag_id[2] tag_image_max_height[200] ~~

set the image to a maximum height of 200 pixels.

tag_image_max_width[]

You can set the maximum width in pixels of the image associated to the #hashtag.

Example:

~~ flexContent action[tag] tag_id[2] tag_image_max_width[200] ~~

set the image to a maximum width of 200 pixels.

tag_name[]

Depending on the action[] context flexContent will show or show not the name of the associated #hashtag

  • show the #hashtag name with tag_name[1] or tag_name[true]
  • suppress the #hashtag name with tag_name[0] or tag_name[false]

Example:

~~ flexContent action[tag] tag_id[2] tag_name[false] ~~   

will not show the #hashtag name.

title_level[]

flexContent is using <h1> ... <h5> tags for the different titles (headers) within the templates. By default the title of flexContent Article will get a <h1> tag. If you have already set a <h1> outside of the article you can use title_leve[] to tell flexContent to start at another level, i.e. with a <h2> tag:

~~ flexContent action[view] content_id[2] title_level[2] ~~

will cause flexContent to start with <h2>.

type[]

This parameter is used in context with the parameter action[list] and can specify special types of lists. Possible values are:

~~ flexContent action[list] type[simple] ~~

will generate a list of actual articles with less details, just try action[list] with type[simple] and without type[simple] to see the difference.

~~ flexContent action[list] type[event] ~~

will generate a list of actual events. This list will not show any regular article.

~~ flexContent action[tag] type[listing] ~~

will generate a list with #hashtag beneath #hashtag which can be placed everywhere in the frontend of the CMS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment