Short codes allow you to output more advanced content on your pages and forms, without having to know how to code.  For example, maybe you want to list a couple of campaigns on a 'Projects' page.  Or, you want to list the top 3 blog articles on your home page.

Usage

You can reference short codes like this:

[short_code_name option_one=”value_one” option_two=”value_two”]

In this example, we’ll simply output the name of your organization in a paragraph.

Welcome to the [global name=”clientName”] Website.

In this example, we’ll output a blog to the page.

Here’s the latest posts from our blog:

[display_feed name=”My Blog”]

[list_pages]

Outputs all the page nodes in your website using an unordered list and anchor tags.

Optional Parameters

levels - Defines the number of nested levels to return. (Ex: levels="3")
parent_id - Filter the pages by a parent page id. (Ex: parent_id="12")
sibling_id - List all sister pages of the current page, excluding the current page. (Ex: sibling_id="12")
show_offline
- (0 or 1) Optionally force offline pages to be returned.
show_hidden - (0 or 1) Optionally force hidden pages to be returned.

Examples

Build your entire menu system in your header, with only 1 level of nested menus.

[list_pages levels=”2”]

For the current page you’re viewing, list all the sister pages.

[list_pages sibling_id=”3”]

[list_sibling_pages]

Outputs all the sibling pages of the current page. Sibling (aka ‘sister’) pages are pages within the same level under the same heading.

For example, if your top level page was ‘A’ and underneath this you have pages A.1, A.2 and A.3 and you put [list_sibling_pages] in to page A.2, you will see a bulleted list of pages A.1, A.2 and A.3.

Optional Parameters

levels - Defines the number of nested levels to return.
show_offline - (0 or 1) Optionally force offline pages to be returned.
show_hidden - (0 or 1) Optionally force hidden pages to be returned.

[list_categories]

Outputs all the product categories in your website using an unordered list tag and anchor tags.

Optional Parameters

levels - Defines the number of nested levels to return.
parent_id - Filter the pages by a parent category id.

[global]

Outputs any of the global settings specific to your shop.

[global name="setting_name_here"]

Optional Parameters

name - The name of the global setting to return.

[page]

Outputs any of the settings specific to the individual page being displayed.

[page name="page_setting_here"]

Options

id, title, metadescription, metakeywords, parenttitle, headerimage

[ds_head]

Outputs all the meta tags and script tags appropriate for your shop, including:

  • meta description
  • meta keywords
  • IE 6 redirect (required for all DS.com shops)
  • jquery.js & jquery easing Libraries
  • jc.js and css Libraries
  • ds.js and css Libraries
  • google analytic

[site_badges]

Outputs a div element, class name ‘dscom’, that includes to images wrapped in anchor tags containing the GiveCloud logo and SSL logo.

[product_search_form]

Outputs the product search <form> tag and contents.

[cart_link]

Outputs the link to view the cart and checkout. See cart_preview.

[cart_preview]

Outputs the appropriate HTML elements for the cart preview. This must exist when using [cart_link].

[display_feed]

Outputs any one of the appropriate feeds.

[display_feed name="Name of your blog or feed"]

[list_products]

Outputs a list of products.

Parameters

max_products - The maximum number of products to return. Ex: max_products="5"
category_ids - A comma delimited list of category ids. To determine the category, open the category in JPanel.  The category ID is the number after the ‘i=’ sign in the link shown in the browser address bar, e.g.; ...edit?i=8. Ex: [list_products category_ids="8,9"]  
product_codes - A comma delimited list of product codes.
Ex: [list_products product_codes="75DD755,126A1E5A"]  
order_by - Options are name_asc, name_desc, date_asc, date_desc
wrapper_class - The class given to the DIV element that will wrap the HTML that is output.  
use_ul - (0 or 1) If 1, this shortcode will return the products in a UL/LI element set.

[display_dp_transaction_history]

Outputs a table of gift history directly from DonorPerfect.

Example

[display_dp_transaction_history columns="date,receipt_number,amount" start_date="2016-06-01"]

Optional Parameters

columns - List of columns to display (date, receipt_number, reference, amount, fair_market_value, net_donation)
start_date - Don't show gift data BEFORE this date. (Format: 2019-12-31)
end_date - Don't show gift data AFTER this date. (Format: 2019-12-31)
gl_codes - Limit gift data to this list of GL Codes from YOUR DonorPerfect system.
gift_types - Limit gift data to this list of Type of Gift Codes from YOUR DonorPerfect system.

[submit_to_email]

Create a custom form that submits to a specified email address.

Optional Parameters

name - added as the name attribute on the FORM tag
email_to - list of emails (csv string) (required)
email_cc - list of emails (csv string)
email_bcc - list of emails (csv string)
success_url - URL  (if not present returns JSON response)
fail_url - URL (if not present returns JSON response)
captcha - accepted values: true or false (defaults to true) 

Example

[submit_to_email name="contactForm" email_to="info@example.com" success_url="/contact-us" fail_url="/contact-us"]
  <input name="email_subject" type="hidden" value="Contact Request">
  <div class="form-group">
    <label>Full Name</label>
    <input class="form-control" name="Full Name" type="text" required>
  </div>
  <div class="form-group">
    <label>Email</label>
    <input class="form-control" name="Email" type="email" required>
  </div>
  <div class="form-group">
    <label>Comments</label>
    <textarea class="form-control" name="Comments" required> . </textarea>
  </div>
  <div class="form-group">[recaptcha]</div>
  <div class="form-group">
    <button class="btn btn-primary" type="submit">Submit</button>
  </div>
[/submit_to_email]
Did this answer your question?