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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 3, 2025

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

      June 3, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 3, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 3, 2025

      All the WWE 2K25 locker codes that are currently active

      June 3, 2025

      PSA: You don’t need to spend $400+ to upgrade your Xbox Series X|S storage

      June 3, 2025

      UK civil servants saved 24 minutes per day using Microsoft Copilot, saving two weeks each per year according to a new report

      June 3, 2025

      These solid-state fans will revolutionize cooling in our PCs and laptops

      June 3, 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

      Community News: Latest PECL Releases (06.03.2025)

      June 3, 2025
      Recent

      Community News: Latest PECL Releases (06.03.2025)

      June 3, 2025

      A Comprehensive Guide to Azure Firewall

      June 3, 2025

      Test Job Failures Precisely with Laravel’s assertFailedWith Method

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

      All the WWE 2K25 locker codes that are currently active

      June 3, 2025
      Recent

      All the WWE 2K25 locker codes that are currently active

      June 3, 2025

      PSA: You don’t need to spend $400+ to upgrade your Xbox Series X|S storage

      June 3, 2025

      UK civil servants saved 24 minutes per day using Microsoft Copilot, saving two weeks each per year according to a new report

      June 3, 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 

    Hostinger
    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

    BitoPro Silent on $11.5M Hack: Investigator Uncovers Massive Crypto Theft

    June 3, 2025
    Security

    New Linux Vulnerabilities

    June 3, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    PINE: Efficient Norm-Bound Verification for Secret-Shared Vectors

    Development

    CVE-2025-4767 – Defog-ai Introspect Code Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Best WordPress Plugins to Try Out in 2025

    Web Development

    Apache Cordova App Harness Targeted in Dependency Confusion Attack

    Development

    Highlights

    Development

    Broadcom Patches VMware Aria Flaws – Exploits May Lead to Credential Theft

    January 31, 2025

    Broadcom has released security updates to patch five security flaws impacting VMware Aria Operations and…

    Chrome 136 Released With Patch For 20-Year-Old Privacy Vulnerability

    April 30, 2025

    CVE-2025-37092 – HPE StoreOnce Command Injection Remote Code Execution

    June 2, 2025

    Amazon Bedrock Guardrails announces IAM Policy-based enforcement to deliver safe AI interactions

    March 18, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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