Basic Shortcodes Overview

You don't need to be a developer to build and manage a Solodev website. However, utilizing shortcodes allows you to enhance the functionality of your site and gives you the ability to create special features that will set your site apart from others.

Solodev shortcodes are the contextual templating language of Solodev. By having a templating language in the context of your content schema you are able to code directly against your site content. This allows developers and content editors to work in tandem.

Similar to other templating languages, Solodev uses double brackets [ ] to open and close template expressions and double curly braces for HTML fields {{ }} to open and close template expressions. Inside these brackets a developer can use shortcode functions, and reference content schema properties. These templating expressions are written alongside standard HTML.

This framework enables developers to create special kinds of content and functionality that users can attach to certain pages by adding the corresponding shortcode into the page text. Shortcodes handles all of the tricky parsing, eliminating the need for writing a custom regular expression for each shortcode. Helper functions are included for setting and fetching default attributes. This framework supports both self-closing and enclosing shortcodes.


Shortcode Description
Get Asset File URL Returns the URL path to the specified asset file
Get Asset File Name Returns the name of the specified asset file
Print Date Prints the date out in the format you specify as shown
No Spaces Removes spaces from a string to make it database-friendly
Lower Case Converts string into lower case
Comments Default: PHP (accepts: HTML, PHP) = Type of comment
Admin Only Specifies that the content inside of the [admin_only] code should only be shown on the back end of Solodev
Non Admin Specifies that the content inside of the [non_admin_only] code should only be shown on the front end of the website
Report Errors Turns on PHP error messages and warnings


Please sign in to leave a comment.