Posts

Showing posts with the label Modx Revolution

Eliminating Spam in Modx Forms

Image
I've been trying to find the optimal system for reducing the number of fake leads being generated in Salesforce. Salesforce has a useful tool for generating a Web-To-Lead form which was the template for what had been used on the site so far. There were also a bunch of inline script for form validation which would prevent the form from submitting if fields were not completed (using event.preventDefault()). I looked into Google's reCaptcha , which, with the latest v3, blocks spam submissions without adding any annoying test for the user. reCaptcha v3 eliminates the reCaptcha v2 element that requires users to tick a box before submission So, the goal is to create a Modx form that submits to Salesforce and supports reCaptcha v3. This turned into a three step process: 1. Using FormIt for form validation FormIt was already installed and in use in other places on the site. FormIt provides a simpler way to validate forms, rather than having the write JavaScript to check ...

One Template For Every Page (almost...)

I've recently been working with Modx Revolution 2.5.1 to redesign a company website. It was an existing site so a lot of the structure was already there. But I wanted to create a really flexible design so that whoever was using my templates would be able to completely customise the page, ensuring the site has a continuous global feel but so not every page was indentical in layout. Most pages would use a standard layout template for content, with a few pages using different templates for things such as news posts, documents and resources, and contact forms. The standard content template is comprised of "sections" - some are always displayed and others can be enabled or disabled. Enabling and Disabling Chunks Each of these content sections is written in a chunk. I can throw that chunk into the template and it appears great. I use template variables associated with each chunk (keeping everything ordered in categories) so that the text that will appear on the site is ea...