Code
A variety of free Code Tutorials & Snippets for Treepl CMS users.
30 CODE Snippet/s
Dynamically create a Google Shop feed in XML format for your eCommerce products.
Allow the user to input an arbitrary price value in a generic payment form, such as donation forms or general invoice/service payment forms.
Complete a live CRM lookup (via AJAX) to check if an email address exists after the user enters it in an email field and before the form is submitted.
List all past Events, future Events, or Events by a set date range, including Liquid date calculations.
This Liquid code will hide your Event item in the list view if its capacity is full AND it’s marked as ‘Hide When Full’.
Add links to the previous and next module items from an items detail page.
This snippet displays a product's Volume Discount information in a more meaningful way with quantity brackets and formatted pricing.
This snippet displays the reCAPTCHA policy badge inline within your form layout instead of the default floating badge at the bottom of the page.
This snippet displays a simplified “Next and Prev” style pagination for any module.
This snippet displays a date friendly conversion for the number of secs/mins/hrs/days/wks/mths/yrs since an item was posted. (supports language customisations)
Display the content in the WYSIWYG editor more inline with the site’s styles (or alternate custom styles).
This could be used for showing a different hero image on a home page every time a person visits the page, or just to change things up a bit and give a bit of interest to a page.
Sometimes you need to make a change to a page/module layout/module item content at some distant time in the future, or perhaps at an inconvenient time.
Auto-submit a prefilled login form, to log in an anonymous user, if reCAPTCHA v2 is successfully completed.
Display member details, such as username and subscribed secure zones, on any page.
A simple format for adding a copyright statement to your website with a self updating year date.
This utility provides a way to mark an item as ‘NEW’ when it has been edited, or added, in the last X number of days.
This little script intercepts any annoying browser alerts and converts them to nice, unobtrusive notification overlays.
This vanilla Javascript will to split a Full Name Field into the system First Name and Last Name Fields.
Liquid snippet to generate breadcrumbs for pages and module items based off the URL structure.
Simple image gallery referencing a folder of images with the File API along with a jQuery lightbox implementation.
Sort a Liquid collection by 2 different fields at once and override weight sorting when weighting is used.
Liquid snippet to place on your form submission page, to display customisable confirmation message and submission data formatting.
Simple Twitter & OpenGraph schema to add rich meta data for your pages for use with social media and other services.
Re-direct a form submission to a custom thank-you page.
Liquid snippet to output Font Awesome Icons for downloadable files from a Custom Module.
Liquid code snippet to apply versioning to your css, javascript and other asset files to override caching.
Liquid snippet to process images (resize, compress, etc...) by 'Device Type' using Liquid and Treepl's ImageProcessor.