Shortcodes in Solodev

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.

Basic 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 Content inside of the [admin_only] code should only be shown on the back end of Solodev
Non Admin 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

Pages & Sectionals

Shortcode Description
Page Title Pulls the current title of a page.
Page Description Pulls the current description of a page.
Page Path Returns the current url path to the page.
Parent Title Pulls the current title of the parent folder.
Parent Description Pulls the current description of the parent folder.
Section Title This will check for the parent category title
Section Description This will check for the parent category description
Solodev Nav Displays the structured folders in the navigation (left or main).
Breadcrumb Returns the formatted breadcrumb tail for the current page.
Social Share

Adds social share buttons that link to social media accounts.

Modules

Shortcode Description
Repeater Pulls all entries from a module
Detail Pulls all details of a single entry from a module
Calendar Entry Attachments Repeat Displays the attachments of a given calendar entry
Entry Categories Repeat  Displays the categories of a given calendar entry
Categories Exist Checks to see if the module is associated with any datatable category group
Category List Prints out all applicable categories of the specified datatable category group
Category Description Pulls a category description by category ID. 
Thumbnail Image Creates a thumbnail version of the Solodev gallery images
Full Calendar Includes Returns libraries for a full calendar fullcalendar.io
JS Full Calendar Instantiates a calendar with full calendar integrated
Event Date Prints the event end date, typically along with the event's start date and time
Solodev Form Populates the form from a datatable by specified datatable ID
Landing Page Form  Displays a form and handles submissions data for associated landing page
CAPTCHA Generates a captcha code image with input field to be included on a form.
Google Calendar URL Generates a Google Calendar URL for the specified calendar entry.  
iCal URL Generates an iCalendar URL for the specified calendar entry  

Module Pager 

Shortcode Description
Pager Includes Returns libraries for pager js. 
Category Filter Allows you to filter entries by category 
Category Repeat Retrieves the categories to be displayed 
Date Filter  Allows you to filter entries by date 
Search Filter Allows you to search module entries 
Tag Filter  Allows you to filter entries by their associated tag 
Template Repeater  Populates pager.js repeater template by ID
Template Value Set Checks to see if the subject parameter is set
Template Value Set Assignment  Checks to see if variable is set, returns default value if not 
Template Conditional  Provides the ability to add conditional statements in your pager.js templates  
Template Preview Length  Provides the ability to set the number of characters to display 
Template Print Date Prints date in pager.js template
Create JS Now Time   Returns the rounded value of the current time  
Pager Controls  Allows you to set pager controls on a web page or module in Solodev 
JS Pager Total  Retrieves total number of items per page 
Page Filter  Displays the specific number of entries on a page 
JS Pager  Connects pager to a module and specifies the display of its entries 

User 

Shortcode Description
Form Login  Provides a form wrapper for users to create a login form for secured areas
Form Register  Provides a form wrapper for users to create users to access secured areas
Form Error Messages  Displays any error messages related to a login attempt 
Form Forgot Password  Populates a forgot password utility linked to your form 
User Documents When used in an Intranet page, this will display documents pertaining to the active user
Net-Results  Connects your landing page module to Net Results Marketing Automation Software 

Miscellaneous

Shortcode Description
Google Search (with ads)  Embeds Google Custom Search with ads on your website 
Google Search (no ads)  Embeds Google Custom Search  on your website
Conditionals  Allows you to add conditional statements to your templates 
URL Variable  Submits a $_REQUEST and passed in requested variable 
Set & Empty  Checks to see if a given variable is set 
Value Set  Checks to see if the specified value is set 
Random  Returns a random number - you can also set min/max (need use case for code example)
Month Filter  Allows you to filter module entries by month 
Login/Logout  Creates a link to log in or log out of a given session. 

0 Comments

Please sign in to leave a comment.
Have more questions? Submit a request