When working with sites deployed to the Optimizely DXP, you may want to restrict access to the site in a particular environment to only authenticated users. This is useful when you're working on a site that's not yet live, and you don't want outside visitors to see the "work in progress" version of the site. I also see this requirement quite often for the non-production environments (integration and preproduction), which are commonly used for testing or training.
One way to lock down these environments is by simply updating the website's access rights in the environment's Settings (also known as Admin Mode), which is stored in the database tied to that environment. However, if you often synchronize the content from the production environment to the non-production environments, these settings will get overwritten and you'll continually have to remember to update them again.
A better way to achieve this is by creating an authorization filter that forces users to log in before they can access the site, and to use this filter in the DXP environments where you want to restrict access.
While this is not something you would commonly do, here's how I approached converting a FormContainerBlock type to our custom ExtendedFormContainerBlock in Optimizely Forms for CMS 12. You may need to do this if you want to add custom properties or functionality to the standard FormContainerBlock type, and you don't want to rebuild or recreate all previously created forms.
When working with Optimizely Forms, you'll find there are multiple ways to configure the functionality of a form. One of those options an editor can configure is "Allow multiple submissions from the same IP/cookie", which is commonly used to prevent/deny a visitor from resubmitting the form, and it works by creating a browser cookie with the form's information.
While this can be a useful option to have to prevent a visitor from continually resubmitting a form, it's not foolproof. A visitor could easily resubmit the form in incognito mode (private browsing), or simply clear their browser cookies to resubmit the form, or just wait until the cookie expires.
But what if you want to allow the user to resubmit the form after a certain amount of time? Let's look at how we can change the timeout for a form resubmission.
Here's a quick code snippet for adding a logout link to the Quick Navigator menu in Optimizely CMS 12. This is done a bit differently in CMS 12, since the logout page is using Razor Pages instead of WebForms, and the new logout method requires an antiforgery token.
What first started out as a "nice to have" feature, has now turned into a bigger experiment with EditorDescriptor. The original idea was pretty simple: "Can the font be changed in the Optimizely CMS UI for a textarea (string) property editor, maybe to something like a monospaced font where editors can provide additional styles or scripts?"
Here's a quick write-up about what I've learned when creating and modifying client side property editors.