Skip to content

Instantly share code, notes, and snippets.

@thetrickster
Last active December 18, 2015 03:29
Show Gist options
  • Save thetrickster/5718819 to your computer and use it in GitHub Desktop.
Save thetrickster/5718819 to your computer and use it in GitHub Desktop.
Business Catalyst Multiple Random Web App Items - Custom Module Template See comments below.
webAppItems.push({id: {tag_itemid}, name: "{tag_name_nolink}", url: "{tag_itemurl_nolink}", image: "{tag_image_value}"});
@thetrickster
Copy link
Author

Business Catalyst Multiple Random Web App Items

See the HTML/Scripts that call this custom module layout at: https://gist.github.com/thetrickster/5718742
See the javascript function/code needed for this implementation: https://gist.github.com/thetrickster/5718857

Custom Module Template

  • Create a file on your BC site with a filename that ends in ".tpl" and save it to your website.
  • Then, make sure this template only has the code below in it.
  • Save it and remember where you saved it so we can use this module template in our webapps module on the page/template where we are showing multiple random web app items.

Adding new web app fields/tags

  • To add another web app field to capture in the array, simply add it to the array above in the syntax:

    , key: "value"

    Note: Notice the comma. You'll need to add a comma before you can add a key/value pair to the array.

Where it says "value" include your template tag that will generate output.

Important - Using {tag_description} will break the array and the rest of your javascript. Pay attention to your browser's developer console for javascript errors while adding new tags/fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment