Formulas

f_basic

firstChildID

The name says it all: retrieve the first child ID of a given ID.

romanesco.patterns.preview_not_available.

getContextSetting

Retrieve a specific setting from a context of choice. Useful if you want to "borrow" a setting from another context, e.g. the correct site_url for assets only available in that context.

romanesco.patterns.preview_not_available.

getElementDescription

Retrieve the description of an element. Used in the front-end library to prevent having to enter the same information twice. This paragraph is also loaded with getElementDescription!

romanesco.patterns.preview_not_available.

getRawTVValue

Get the raw value of a TV. Usually when retrieving a TV value, it gets processed first before being returned. But sometimes you need the unprocessed value instead, e.g. when using @inherit.

romanesco.patterns.preview_not_available.

getTmplvarID

Get the ID of a TV, in case you only know its name. Created for the front-end library, to help with listing included TVs.

romanesco.patterns.preview_not_available.

returnFirstHit

Feed it a bunch of properties and it spits out the first one that's not empty. Property names are irrelevant. Sort order is all that matters.

romanesco.patterns.preview_not_available.

f_content

tableOfContents

romanesco.patterns.preview_not_available.

f_contentblocks

cbHasFields

This is a copy of the original cbHasField snippet that ships with ContentBlocks. The only difference is that it takes in a comma separate list of IDs, instead of just 1.

romanesco.patterns.preview_not_available.

cbRenderCodeField

For use in a CB Code field, together with a field setting to control how the :tag modifier is rendered. Useful for dealing with MODX tags inside a Code field, i.e. when writing documentation.

romanesco.patterns.preview_not_available.

f_data

migxResetNULL

After save hook for MIGXdb. Prevents database fields with default value of NULL from being set to 0 after a save action in MIGX.

romanesco.patterns.preview_not_available.

migxSaveOption

Aftersave hook for MIGXdb. Gets and sets the group (parent) ID inside a nested configuration. Also generates an alias if none is present and increments the sort order.

romanesco.patterns.preview_not_available.

migxSaveOptionGroup

Aftersave hook for MIGXdb. Updates existing keys in child options if you change this setting in Group. Also increments the sort order.

romanesco.patterns.preview_not_available.

migxSaveRelated

Aftersave hook for MIGXdb. Sets source and target IDs in opposite direction also, to establish a double cross-link. Yeah, better watch your back with those!

romanesco.patterns.preview_not_available.

migxSaveRepurposeDest

Aftersave hook for MIGXdb. Sets current resource ID as re-purpose source.

romanesco.patterns.preview_not_available.

migxSaveRepurposeSrc

Aftersave hook for MIGXdb. Sets current resource ID as re-purpose destination.

romanesco.patterns.preview_not_available.

migxSaveTaskComment

Aftersave hook for MIGXdb. Links the comment to the parent task.

romanesco.patterns.preview_not_available.

renderInputOption

Fetch option name from the romanesco_options table (when used as output modifier). You can also get other available fields with a regular snippet call and tpl chunk.

romanesco.patterns.preview_not_available.

f_formblocks

fbFormReport

Generates a report from submitted field values. Primarily for emails, but you can also use this snippet to template other kinds of functionality (confirmation pages, multi page forms..).

romanesco.patterns.preview_not_available.

fbGetForms

romanesco.patterns.preview_not_available.

fbInputRepeater

Parse the HTML output of repeating form fields and remember the submitted values of each field, in case the page is reloaded.

romanesco.patterns.preview_not_available.

fbLoadAssets

romanesco.patterns.preview_not_available.

fbValidateProcessJSON

Generates the correct strings for the FormIt &validate property.

romanesco.patterns.preview_not_available.

f_fb_hook

fbEmptyHook

Dummy hook to trick FormIt into not throwing errors saying there are no hooks, and to make the comma separation between hooks a little easier.

romanesco.patterns.preview_not_available.

fbSetStoredValues

Populate field values with available data stored in the user session. Enabled by default when using multi-page forms.

romanesco.patterns.preview_not_available.

f_fb_modifier

fbPrefixOutput

romanesco.patterns.preview_not_available.

fbResetNonAlpha

romanesco.patterns.preview_not_available.

fbStripAsAlias

romanesco.patterns.preview_not_available.

fbStripNonAlpha

romanesco.patterns.preview_not_available.

f_framework

FibonacciSequence

Generate a sequence of Fibonacci numbers. In a Fibonacci sequence, every number after the first two is the sum of the two preceding ones.

romanesco.patterns.preview_not_available.

Hits

Overwrites the default snippet inside the Hits package. Contains a fix for preventing fatal errors in PHP 8.

romanesco.patterns.preview_not_available.

modifiedIf

Customized If snippet with additional 'contains', 'containsnot' and 'isnumeric' operators, output to placeholder and option to prevent chunks from parsing before If statement is evaluated.

romanesco.patterns.preview_not_available.

setBackground

Output the necessary class names for the applied Global Background.

romanesco.patterns.preview_not_available.

setBoxType

Output the necessary class names for Overview patterns, based on their template. It was created because the chunks where getting a bit swamped by output modifiers trying to do the same thing.

romanesco.patterns.preview_not_available.

f_hub

assignedTVs

romanesco.patterns.preview_not_available.

includedBosons

romanesco.patterns.preview_not_available.

includedChunks

romanesco.patterns.preview_not_available.

includedSnippets

romanesco.patterns.preview_not_available.

includedTVs

romanesco.patterns.preview_not_available.

referringBosons

romanesco.patterns.preview_not_available.

setPatternPlaceholders

romanesco.patterns.preview_not_available.

setPatternType

romanesco.patterns.preview_not_available.

f_json

jsonGetObject

Search a JSON object for specific item and return the entire array. This is initially intended to turn CB repeater elements into CSS, without having to change the internal templating in CB.

romanesco.patterns.preview_not_available.

jsonGetValue

Get the value of a specific key from a JSON string.

romanesco.patterns.preview_not_available.

jsonImportInputOptions

Generate input options from a JSON file. These options are written directly into their database table inside the Backyard package.

romanesco.patterns.preview_not_available.

jsonToHTML

Turn a JSON object into an HTML table. For documentation purposes.

romanesco.patterns.preview_not_available.

stripForJSON

Prepare the input for being used in JSON. This means escaping backslashes and double quotes.

romanesco.patterns.preview_not_available.

tvToJSON

Output the properties of given TV to a JSON object. The output could be used by jsonToHTML to generate an HTML table.

romanesco.patterns.preview_not_available.

f_modifier

beforeEach

Grab a comma-separated list and prefix all items with given value. Optionally, the separator can be changed and output can be forwarded to a placeholder.

romanesco.patterns.preview_not_available.

clipString

Trim the edges of a string. The given value represents the number of characters that will be clipped. If the value is negative, they will be clipped from the end of the string.

romanesco.patterns.preview_not_available.

filterLine

Search the input for lines containing a specific string. And then return those lines.

romanesco.patterns.preview_not_available.

parseTags

Take in a comma separated string and turn each value into a separate tag. Sometimes you just need that :)

romanesco.patterns.preview_not_available.

removeDuplicateLines

Scan input for duplicate lines and remove them from the output.

romanesco.patterns.preview_not_available.

replaceRegex

Find patterns with regex and replace them. By default, it removes all matches. If you want to replace each match with something else, you have to use a regular snippet call.

romanesco.patterns.preview_not_available.

round

Round a decimal value to a whole number or with a specified amount of decimals. Usage: returns the value with 2 decimals, returns a whole number.

romanesco.patterns.preview_not_available.

splitString

Divide string into multiple sections, based on a delimiter. Regular snippet call outputs sections to placeholders. If used as output modifier, specify the number of the part you want to get.

romanesco.patterns.preview_not_available.

stripAsAlias

Turn input into lowercase-hyphen-separated-alias-format and strip unwanted special characters. Useful for creating anchor links based on headings, for example.

romanesco.patterns.preview_not_available.

stripForJS

Prepare the input for use in Javascript. This means escaping certain characters to make sure the surrounding HTML doesn't break.

romanesco.patterns.preview_not_available.

stripWords

As opposed to the native MODX stripString modifier (which only allows you to strip a single value), stripWords lets you enter multiple (comma separated) values.

romanesco.patterns.preview_not_available.

textToNumber

Turn a written number into an actual numeric value. In other words: turn "three" into "3". Can come in handy if you want to use the Semantic UI column width classes for other purposes.

romanesco.patterns.preview_not_available.

f_performance

generateCriticalCSS

Utility snippet to determine which CSS styles are used above the fold and write them to a custom CSS file. This needs NPM and the critical package to be installed.

romanesco.patterns.preview_not_available.

generateStaticFile

Create a physical HTML file of a resource in the designated location. This is a utility snippet. Place it in the content somewhere and visit that page in the browser to generate the file.

romanesco.patterns.preview_not_available.

imgOptimizeThumb

Post hook for pThumb, that runs after the thumbnail is generated. It uses the Squoosh library from Google to create a WebP version of the image and optimize the original.

romanesco.patterns.preview_not_available.

minifyCSS

Generate minified version of given CSS file. To avoid increased saving times, execution of the Gulp process will be added to a task queue if Scheduler is installed.

romanesco.patterns.preview_not_available.

f_presentation

getImageDimensions

Retrieve width and height from physical image files. Auto detects SVGs.

romanesco.patterns.preview_not_available.

getVimeoData

Retrieve the largest existing thumbnail image available. You can choose between JPG and webP extension. Can be used as output modifier as well.

romanesco.patterns.preview_not_available.

getYoutubeThumb

Retrieve the largest existing thumbnail image available. You can choose between JPG and webP extension. Can be used as output modifier as well.

romanesco.patterns.preview_not_available.

iconInputOptions

Generate input options with all Semantic UI icon classes.

romanesco.patterns.preview_not_available.

loadAssets

Load CSS and JS for a specific component. Some assets are included in semantic.css by default, to keep its file size down.

romanesco.patterns.preview_not_available.

responsiveImgSrcset

Generate a number of srcset properties, for use inside an img tag.

romanesco.patterns.preview_not_available.

sliderLoadAssets

Load CSS and JS dependencies for Swiper slider. It also initializes a Swiper instance for each slider, with it's own parameters. This means you can use multiple sliders on one page.

romanesco.patterns.preview_not_available.

statusGridLoadAssets

Load CSS and JS dependencies for status grid.

romanesco.patterns.preview_not_available.

stepsLoadAssets

Load CSS styles for Steps component. This is not included in semantic.css by default, to keep its file size down.

romanesco.patterns.preview_not_available.

tabsGenerateNav

Generate the tab buttons based on data-heading attribute in the tabs themselves. It basically links every tab button to the correct tab content.

romanesco.patterns.preview_not_available.

f_resource

getChildCount

Return the amount of child pages a resource has. Now you can make one of those shiny little badges inside a menu button, telling the user upfront how much treasure is inside.

romanesco.patterns.preview_not_available.

getResourceLevel

Show the level of a given resource based on the number of parent IDs. Useful for example if you only want to show a breadcrumb trail on pages that are two or three levels deep.

romanesco.patterns.preview_not_available.

renderContentType

Takes an ID as input and returns the content type. Mainly intended as snippet renderer for Collections, but can be used independently or as output modifier too.

romanesco.patterns.preview_not_available.

renderResourceName

Takes an ID as input and returns the pagetitle. Mainly intended as snippet renderer for Collections, but can be used independently or as output modifier too.

romanesco.patterns.preview_not_available.

resourceMediaPath

Standalone version of a snippet that comes with MIGX. Generates subfolders in media sources. Keeps your folder structure tidy when adding lots of images in lots of resources (e.g. galleries).

romanesco.patterns.preview_not_available.

resourceTVInputOptions

Generate input option values that can be used in TVs, for creating resource selectors.

romanesco.patterns.preview_not_available.

SeoTabIndexation

If SeoTab (StercSEO) is installed, this snippet displays the indexation setting for given resource.

romanesco.patterns.preview_not_available.

f_user

checkPermissions

Check if user is allowed to access the given (or current) context and redirect to unauthorized page if that's not the case.

romanesco.patterns.preview_not_available.

isEditor

Check if user is logged in to the manager.

romanesco.patterns.preview_not_available.

renderUserName

Gets user by ID and returns the username. Mainly intended as snippet renderer for Collections, but can be used independently or as output modifier too.

romanesco.patterns.preview_not_available.

setUserPlaceholders

Make any extended fields that are attached to a MODX user available as placeholder.

romanesco.patterns.preview_not_available.