Knowledgebase



 Categories





 Dimofinf Mobile


Subscribe now to Dimofinf Mobile and enjoy a wide range of premium services. You will receive our SMS text messages wherever you are for a very low cost! More


 Currency Converter


  • Currency
  • US$ Amount

Helping functions which can be used in the blocks



      {function:alternate name="blockname" values="alt1,alt2"}

This function is used to swap values where it swaps values every time.

Parameters:

  • name (optional): used to assign a name for it and is useful when this function is called more than once within more than one block and it is preferred to assign a name for it.
  • values (mandatory): the values it will swap among separated by a comma.

Example:

CODE :
{function:alternate values="alt1,alt2"}
{function:alternate name="row" values="one,two,three"}

      {function:calc values="1,5" sign="+"}

This function is used to perform mathematical operations on the values.

 Parameters:

  •  sign (optional): the operation sign; '+' for addition, '-' for subtraction, '*' for multiplication and '/' for division.
  •  values (mandatory): the values the mathematical operations will be done on.

Example:

CODE :
{function:calc values="1,5,8" sign="*"}

      {function:getpermalink file="news" args="action=s&id=1" default="false" outputfiletype="xml" caption="{caption}"}

This function returns the full URL to the form you specified in the Dimofinf settings and according to the parameters you passed for the function.

Parameters :

  • $file (mandatory): the file name for the URL.
  • $args (optional):the URL variables in the form of QUERY_STRING.
  • $outputfiletype (optional): this is the value for determining the URL extension. This is used if you want the file extension to be anything else other than '.php' which is the default. This function only works when shortened URLs are disabled.
  • $default (optional): the value 'boolean true/false' is used to force the function return the URL to its default form whether shortened URLs are activated or not.
  • $caption (optional):add text whether a content title or anything else to insert among the URLs. This works if the 'Shortened URLs followed by a title' is activated.

Example:

CODE :
{function:getpermalink file="albums"}
{function:getpermalink file="news" args="action=s&id=1"}
{function:getpermalink file="news" args="action=s&id=1" outputfiletype="xml"}
{function:getpermalink file="news" args="action=s&id=1" default="true"}
{function:getpermalink file="news" args="action=s&id=1" caption="{caption}"

      {function:randomcolor}

This function chooses a random color code.

Example:

CODE :
{function:randomcolor}


Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Block system tags within the block files & Variables, constants and general variables (Views: 561)

Block system tags within the block files: The blocks system has several tags that are placed in...


Modifiers functions (Views: 508)

As it has been explained before in the variables tag, modifiers are functions that modify the...


$tpl object functions within the PHP file (Views: 392)

    - mk_template($var) This function is called to create a $tpl object as special $tpl...


Blocks system (Views: 479)

Dimofinf offers you an exclusive state of the art blocks system through which you can separate...


Helping function used for blocks (Views: 479)

This is a set of helping functions which can be used in your programming for some ready parts...



Online