I have exploring Optimizely Forms recently –Â Installed NuGet package to enable Optimizely Forms, created a Contact Us Form and placed in a landing page. Sharing my learning from installation to submission.
Let’s get started.
To enable Optimizely Forms, we need to install NuGet package for Forms – It can be installed via NuGet Console or Manager. I prefer GUI since it’s more visual.
EpiServer.Forms
EpiServer.Forms.Core
EpiServer.Forms.UI
Let’s run the project – localhost:5000 now will have a new tab Forms besides Blocks and Media.
Create a New Form by right clicking on EpiServer Forms – named it as Contact Us Form.
Let’s add the fields by drag and dropping into the Content Area.
Quick Edit to change the Label, Tooltip, Required field and RegEx if needed. Save and Publish the changes.
Note: Each field needs to be published.
Similarly, I have created the following fields –
First Name – Text
Last Name – Text
Email – Text
Comment – Text Area
Submit Button
Note: The Email is Text field with the Email checkbox checked.
Form is now ready to be placed in any landing page.
Let’s create a Standard Page or any page with Content Area.
Drag and Drop the Contact Us Form into the Content Area and publish the changes.
Let’s test the Contact Us Form – we could see the new menu CONTACT US PAGE is automatically added when published the page.
Submitted the Form – Verified that the required field validators are working as expected.
The submitted records are easy to check by pressing the Form Submissions.
The records can be exported in any of the following formats.Â
The records are stored forever by default – feel free to change the retention policy as needed for partial and full submissions.
If you prefer watching a video, my quick recording –
When you’re ready for the exam, you can purchase the exam voucher code for $300. Alternatively, if your company is an Optimizely partner and you have competitor certification, fill out the Opt-up program to receive a free voucher code.
If your company is in the program and you have competitor certification, please fill out the application form, and they will confirm your eligibility within 7 business days.
After confirmation, email when you completed the study materials – they will send voucher code to register for the exam. You need to take the exam within 14 days.
If you prefer watching a video, my quick recording –
The Algolia Search Provider for Sitecore is a powerful integration combining robust content management capabilities with Algolia’s lightning-fast, full-text search engine.
This provider enables Sitecore-driven websites and applications to deliver instant, relevant, and highly customizable search experiences to end-users, ensuring faster content discovery and improved user engagement.
While exploring, I found that Dmitry Harnitski and Peter Procházka have implemented the Algolia Search Provider for Sitecore 9.1 and previous versions. Thank you so much!
I was working on Sitecore SXA 10.3.1 and the workflow was somehow messed up.
Manually modifying can be time-consuming and error-prone. Sitecore SPE is a powerful tool that allows for efficient modification of content in bulk through find and replace text functionality.
In this article, we will explore the steps of using Sitecore SPE to quickly and easily bulk update workflow, streamlining the process, and saving time.
Dry-Run Script:
Running the script won’t make any changes to items, it will give the items that are going to be modified.
I’ve been delving deeper into Sitecore Personalize and have discovered how to incorporate its custom Web Templates into the website.
Let’s dive into the process of creating custom Web Templates and how to utilize them in Web Experiences.
Create Web Template
Let’s navigate to Web Templates in Sitecore Personalize and create it.
Â
The Web Templates have the high flexibility of HTML, CSS, JavaScript, and API tabs to configure.
HTML: Define the structure and content of your web template. This is where you can create the basic layout and elements that will be displayed on your website.
CSS: Style your web template to match your brand’s look and feel. You can add custom styles to ensure that the template is visually appealing and consistent with your website’s design.
JavaScript: Add interactivity and dynamic behavior to your web template. JavaScript allows you to create engaging user experiences by adding features like animations, form validations, and more.
API: Configure API responses to integrate with your organization’s data.
Â
To build the custom web template, let’s say I want to Personalize the About page of my blog.
To create HTML and CSS, we don’t need to dive into the code. A tool called SnipCSS can turn any section of the website into a reusable component.
SnipCSS
SnipCSS is a powerful tool designed to help web developers extract CSS and HTML snippets from any web element or widget. The main key feature is extracting all HTML, images, and CSS with a single click.
Create a separate Authorization in the Identity Server for FormsÂ
Create a Controller to bridge between Custom Submit Action and API call
Set the Custom Submit Action fields
1. Create a separate Authorization in the Identity Server for FormsÂ
Add the FormsServerClient node and its value to the Identity Server’s Sitecore.IdentityServer.DevEx.xml file. After making the change, make sure to IIS Reset for the change to be in effect.Â
Note: Don’t forget to add transforms for ClientSecret!
Â
Ideally, you can call it in Postman to verify that it’s generating a token using Form’s ClientID and ClientSecret values mentioned in the Sitecore.IdentityServer.DevEx.xml file.
Now that the config is all set to have its own ClientID and ClientSecret, let’s set up the Authorize method with BearerToken specifically for Form’s Identity Credentials.
The SitecoreRestServices handles authenticated HTTP requests to Sitecore’s REST APIs, managing access tokens and retrying requests if authentication fails. It uses dependency injection to configure the HTTP client and obtain the necessary settings.
2. Create a Controller to bridge between Custom Submit Action and API call
Let’s bridge the Custom Submit Action and API call – The CustomController class extends SitecoreController and uses dependency injection to obtain an instance of ICreateAutoPublishService.
It defines a CreateAndPublish method – HTTP POST endpoint that processes CreateAndAutoPublishModel, calls the service to create and publish content, and returns a JSON response indicating success or failure.
The method includes error handling to return appropriate HTTP status codes and messages for different exceptions.
3. Set the Custom Submit Action fields
The final step – Let’s set the Model Type and Error Message based on the class we created.Â
Publish the form and its related items. It should be good to go!