You can simply use snippets as output filters, so the process of adding a custom output filter is merely adding a new snippet! Created Feb 14, 2011.
Input Filter Output Filter. When writing your own Output Modifier, your Snippet can take the following inputs: $input; // the value that is being formatted/filtered $options; // optional values passed via backticks
Example with a snippet named 'makeDownloadLink':The most important (and perhaps the most obvious) of these parameters is the As the examples to be found below are not included in the core, you will need to add these yourself. eerne / emailObfuscate.php. In MODX, the date output modifier, which is used to format dates using PHP's strftime () function, expects a unix timestamp. Filters in Revolution allow you to manipulate the way data is presented or parsed in a tag. In general, any content in a placeholder that you think Sometimes, output modifiers can be used on a cached placeholder - but only if you're calling the Snippet that sets them cached as well. Output Options All gists Back to GitHub. Creating a Custom Output Modifier.
I have this code in a template [[+isShowMore:is=`1`:then=`show more`:else=`no`]] It is printing no. This tutorial will hopefully allow you to get a deeper understanding of several of the used concepts and help you further develop highly customizable … Skip to content. Although the examples below are placeholder tags, the output modifiers can be used with any MODX tag. Star 0 Fork 1 Code Revisions 2 Forks 1. Check the page on MODX's built-in output filters "Input and Output Filters (Output Modifiers)") before writing your own filter. Sign in Sign up Instantly share code, notes, and snippets. The syntax looks like this: [[element:modifier=`value`]] They can also be chained (executed left to right): Contribute to DashMedia/MODX-hisrc-output-modifier development by creating an account on GitHub. In order to turn a formatted date into a unix timestamp, you will use the strtotime output modifier. In Revolution, the Output Filter applies one or more of series of output modifiers, which behave similarly to PHx calls in MODX Evolution - except they're built into the core. Custom Output Filters are MODX Snippets dedicated to formatting placeholder output in the view layer (in a Template or in a Chunk). Otherwise, you're performing an illogical maneuver - trying to cache statically something that was never meant to be static.In general, the rule is: If you set a placeholder in an uncached Snippet, the placeholder needs to be uncached as well if you expect the content of the placeholder to differ.If you have properties on the tag, you'll want to specify those This document variable call with an output modifier will pass these properties to the snippet:Here is a sample implementation for our snippet makeExciting:The return value of the call will be whatever the snippet returns. To use the output filter, you reference the snippet name.To documentation contributors: please add examples in alphabetical order.alternateClass simply checks if an integer (for example, a counting placeholder) passed can be divided by two. URL TV Output Type. The syntax looks like this:You can also use these to modify Snippet output; note that the modifier comes after the Snippet name and before the question mark, e.g.The following table lists some of the existing modifiers and shows examples of their use.
In this document: Git basics and the first commit of a component on GithubWe assemble and install the first version of the package.We think over the logic of work, determine the schema and model of the databaseMIGX.Fancybox-images with seperate placeholders in Richtext-ContentUsing resource-specific mediasource and multifile-uploader with MIGXUsing resource-specific mediasource and multifile-uploader with MIGX (Old Version)MIGXdb.Create a basic gallery-management from scratch with MIGXdbAdd resource-specific mediasource and multifile-uploader to the galleryMIGXdb.Manage Child-Resources in a grid-TV with help of MIGXdbMIGXdb.Manage Events-Resources in a CMP with help of MIGXdb They allow you to modify values from inside your templates.In Revolution, the Output Filter applies one or more of series of output modifiers, which behave similarly to PHx calls in MODX Evolution - except they're built into the core. emailObfuscate output modifier for MODx. Output Modifiers are a quick way to change the output of most MODX tags, particularly resource field and TV output and placeholders.There is a large selection of conditional and string modifiers, including the very useful "userinfo" for getting user information from the MODX-provided current user placeholder, or any other source of a user ID.
Luckily, MODX makes this ridiculously easy.
If a raw placeholder, e.g.returns a string of text, you can modify it via a custom Output Filter, e.g.In the above example, the pagetitle value will be modified by a Snippet named When writing your own Output Modifier, your Snippet can take the following inputs:The syntax is that the Snippet name comes after a colon. Output modifier for MODX for use with hisrc.js. This output-type allows you to wrap an link (a-tag) around the input (normally should be input-type: "text").