Advanced generator functions

This feature allows you to run a variable through some filter functions. Let’s take and example:

You have this variable: {|content-1|}

This variable contains the text of an article. If you insert that variable in this way into your slide:

{nextend||findimage({|content-1|})}

Then you will get the first image in that text, so you can place this code into an image item’s image parameter and you will see on the image from the article.

{nextend||function1[||function2[||function3[...]]](Variable)}

Available functions

cleanhtml

This function removes every HTML tag from the variable, except: <p><a><b><br><br/><i>

Parameters

This function haven’t got any parameters.

Example

{nextend||cleanhtml(Variable)}

removehtml

This function removes every HTML tag from the variable.

Parameters

This function haven’t got any parameters.

Example

{nextend||removehtml(Variable)}

splitbychars

This function splits the provided variable from the starting char index to the specified length. Similar to substr PHP functions.

Parameters

This function has two parameters, starting index and the length.

#1 parameter: start
#2 parameter: length

{nextend||splitbychars,start,length(Variable)}

Example

This will split your text from the 10th char to the 10+30th char:
{nextend||splitbychars,10,30(Variable)}

splitbywords

This function splits the provided variable from the starting char index before the specified length when the last space char exist. This will result in a text where the last word is not split.

Parameters

This function has two parameters, starting index and the length.

#1 parameter: start
#2 parameter: length

{nextend||splitbywords,start,length(Variable)}

Example

This will split your text from the 10th char before the 10+30th char when it finds a space character:
{nextend||splitbywords,10,30(Variable)}

findimage

This function is searching for images in the provided variable. Allows you to optionally set the image index with parameter if the text has multiple images.

Parameters

This function has one optional parameter, which defines the index of the image in the text. Indexing starts with 0.

#1 parameter: index of the image

{nextend||findimage[,index of the image](Variable)}

Example

The first image from the provided variable:
{nextend||findimage(Variable)}

The third image from the provided variable:
{nextend||findimage,2(Variable)}

Mixing functions

The functions are mixable, you can add two or more functions to a variable. Here are some examples and you will see how it works.

It will remove first the HTML codes from the variable and then split it by words:
{nextend||splitbywords,10,30||removehtml(Variable)}

It will split the variable by words and then remove the HTML codes(see the difference with the previous example):
{nextend||removehtml||splitbywords,10,30(Variable)}

Also you can mix more than 2 variables too:
{nextend||removehtml||findimage||splitbywords,10,30(Variable)}

The previous example doesn’t make much sense, just a demonsration that it can handle any number of functions. If you need more function, feel free to contact us and we will extend the list of the functions.