Skinvars: if/else/endif

Inserts a content block only when certain conditions are fullfilled

Arguments

Only the if skinvar has options

  • type: type of condition
  • name: name of option (optional)
  • value: value to be checked (optional)

Condition types

  • category: condition is fullfilled when a category is selected
    • category: checks if any category is selected
    • category,catname,CategoryName: checks if the current category is CategoryName
    • category,catid,CategoryId: checks if the current category is CategoryId
  • blogsetting: checks if the value name blogsetting equals value (the name is the column name from the nucleus_blog sql table)
  • loggedin: condition is fullfilled if visiting member is currently logged in
  • onteam: condition is fullfilled if visiting member is currently logged in & member of the blog team of the current blog (or the blog given in the name parameter)
  • nextitem: true if there is a more recent item available for the current weblog (item skintype)
  • previtem: true if there is an older item available for the current weblog (item skintype)
  • skintype: checks if the current skin type is equal to value (index, search, item, archive, archivelist, ...)
  • hasplugin: checks if the a plugin is installed, or if a plugin option has been set to a specific value
    • hasplugin,PluginName: checks if plugin is available
    • hasplugin,PluginName,OptionName: checks if a plugin option is not set to 'no'
    • hasplugin,PluginName,OptionName=value: checks if a plugin option is set to a specific value

Skintypes

all

Examples

<%if(loggedin)%>
Welcome back!
<%else%>
Welcom guest!
<%endif%>
<%if(category,catname,Off Topic)%>
Welcome to the 'Off Topic' category.
<%endif%>

Notes

If you want something to be displayed only if a condition is not fullfilled, you can use a construct like this:

<%if(skintype,error)%><%else%>
<%blogsetting(name)%>
<%endif%>
Skin Vars