Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 4, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 4, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 4, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 4, 2025

      Players aren’t buying Call of Duty’s “error” excuse for the ads Activision started forcing into the game’s menus recently

      June 4, 2025

      In Sam Altman’s world, the perfect AI would be “a very tiny model with superhuman reasoning capabilities” for any context

      June 4, 2025

      Sam Altman’s ouster from OpenAI was so dramatic that it’s apparently becoming a movie — Will we finally get the full story?

      June 4, 2025

      One of Microsoft’s biggest hardware partners joins its “bold strategy, Cotton” moment over upgrading to Windows 11, suggesting everyone just buys a Copilot+ PC

      June 4, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      LatAm’s First Databricks Champion at Perficient

      June 4, 2025
      Recent

      LatAm’s First Databricks Champion at Perficient

      June 4, 2025

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025

      Simplify Negative Relation Queries with Laravel’s whereDoesntHaveRelation Methods

      June 4, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Players aren’t buying Call of Duty’s “error” excuse for the ads Activision started forcing into the game’s menus recently

      June 4, 2025
      Recent

      Players aren’t buying Call of Duty’s “error” excuse for the ads Activision started forcing into the game’s menus recently

      June 4, 2025

      In Sam Altman’s world, the perfect AI would be “a very tiny model with superhuman reasoning capabilities” for any context

      June 4, 2025

      Sam Altman’s ouster from OpenAI was so dramatic that it’s apparently becoming a movie — Will we finally get the full story?

      June 4, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Optimizely Spire CMS Page Variants: Custom Rule Type Option

    Optimizely Spire CMS Page Variants: Custom Rule Type Option

    January 9, 2025

    Optimizely Spire CMS provides a feature to create variants of CMS pages. Page variants are variations of a website page with rules for displaying it to end users. Optimizely Spire CMS supports page variants for all CMS pages, including the header and footer. The primary purpose of that user is to see different variations of the same page.

    Optimizely Spire CMS provides a feature to apply rule types on page variants. Optimizely Configured Commerce supports creating custom rule types and rule type options to further use the Rules Engine. The basic requirement of creating a custom rule type or using OOTB on a rule type is that users can see different CMS pages as per the applied rule type.

    This blog provides complete information on creating custom rule-type options. The steps below will help create a custom rule type option in the Optimizely Configured Commerce solution that can be used in the Optimizely Spire CMS.

    How to Create a Custom Rule Type Option in Optimizely Spire CMS

    1. Open Optimizely Configured Commerce solution in Visual Studio.
    2. Go to the “Extensions” class library.
    3. Create a new class, “CustomRuleTypeOption,” and inherit it from the “CriteriaTypeBase” base class. Add Dependency Name attribute with a name of “CustomRuleTypeOption“.Customruletypeoption1
    4. Implement inherited abstract class members.Customruletypeoption2
    5. Change the DisplayName property value to “Custom Rule Type Option“.Customruletypeoption3
    6. Override the remaining properties value.Customruletypeoption4
    7. To show custom rule type option field in CMS, we need to override the “ParameterDescriptions” property and set “Label” and “ValueType” value.Customruletypeoption5
    8. Override the Validate method and add business logic to validate the input value specified in the CMS. If “true” is returned, the user will see the page variant. If “false” is returned, the user will see the default page.Customruletypeoption6
    9. Rebuild the solution.
    10. Login in Admin.
    11. Go to Administration -> System -> Rule Types listing page.
    12. Open the “Page” rule type from the listing page.
    13. Go to “Rule Options” tab and click on “Rule Type Option” button.Customruletypeoption7
    14. Enter “Description” and select the custom rule type option from the “Criteria Type” dropdown and click on the “Save” button.Customruletypeoption8
    15. Log in as a content admin and click the “Edit” icon.
    16. Go to any page and create a variant of the page. For example, go to Header and click on More Options (…).
    17. Select “Create Variant“.Customruletypeoption9
    18. Enter a “Variant Name”, select “Copy Content from Default” and click on “Save” button.Customruletypeoption10
    19. Select the custom rule type option from the rule type dropdown, enter the value, and click the save button.Customruletypeoption11
    20. As per the rule type, verify the variant page on the site.

    References:

    1. https://support.optimizely.com/hc/en-us/articles/4413199746317-Manage-page-variants
    2. https://docs.developers.optimizely.com/configured-commerce/docs/create-custom-rule-type-option-for-cms-variants
    3. https://support.optimizely.com/hc/en-us/articles/4413200007437-Rule-type-options

    __PRESENT

    __PRESENT

    __PRESENT

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDifference Between Lightning Record Pages and Page Layouts in Salesforce
    Next Article Understanding Variables, Data Types, and Constants in VBA

    Related Posts

    Security

    HPE StoreOnce Faces Critical CVE-2025-37093 Vulnerability — Urges Immediate Patch Upgrade

    June 5, 2025
    Security

    35,000 Solar Power Systems Exposed To Internet Are Vulnerable To Cyberattacks

    June 5, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    CVE-2025-40667 – TCMAN’s GIM Missing Authorization Vulnerability (Authorization Bypass)

    Common Vulnerabilities and Exposures (CVEs)

    Here’s how and when to watch The Division 2 Battle for Brooklyn and Year 7 showcase

    News & Updates

    Looking for an AI-powered website builder? Here’s your best option in 2025

    News & Updates

    Design and Code Synchronized

    Development

    Highlights

    Development

    AI-Powered SaaS Security: Keeping Pace with an Expanding Attack Surface

    March 25, 2025

    Organizations now use an average of 112 SaaS applications—a number that keeps growing. In a…

    Implementing a fall forward strategy from Amazon RDS for SQL Server Transparent Data Encryption (TDE) and Non-TDE Enabled databases to self-managed SQL Server

    July 30, 2024

    2025’s highest-rated Xbox game on Metacritic is coming to Game Pass in a matter of days — but you’ve never heard of it

    April 7, 2025

    AI-Driven Human Hacking is a New Frontier in Cybersecurity

    April 16, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.