How to implement a conditional "Exclusive News" property in a multilingual, multi-site Optimizely 12 CMS setup?

Vote:
 

Hi community,

I'm working on an Optimizely CMS 12 project that supports multiple languages and multiple websites. I need to implement a feature on the News Page type with the following requirements:

 Feature: "Exclusive News" Checkbox

  • A boolean property called ExclusiveNews should be added to the News Page type.
  • When this checkbox is checked, the content:
    • Should not be displayed on the current website.
    • Should be sent to another website via an external API call.

 Conditional Visibility for Editors

  • This property should only be visible to editors whose location matches a value selected in the Site Settings (a custom settings page).
  • Editors from other locations should not see or interact with this property.

 Indexing & SEO Requirements

  • The property should not be indexed by Optimizely Search & Navigation (Find).
  • However, it should be available in the Content Search API.
  • The content marked as "Exclusive News" should:
    • Not appear in the sitemap.
    • Not be crawled by Google or other search engines.

 Questions:

  1. How can I conditionally show the ExclusiveNews property in the CMS editor UI based on the editor's location (as defined in Site Settings)?
  2. How can I prevent this content from rendering on the site but still trigger an API call when the property is checked?
  3. What’s the best way to exclude this content from:
    • Optimizely Find indexing
    • Sitemap generation
    • Search engine crawling
  4. How can I still expose this content through the Content Search API?

Any code samples, best practices, or pointers to documentation would be greatly appreciated!

Thanks in advance!

#339636
Jul 11, 2025 15:01
Vote:
 

I'll try to re-post and see if it works this time.

Not sure if all of this is possible, I'll have to do a research about this.
However I do have experience in solving some of these problems.

1. Not sure how to approach this, maybe you can get inspired from this magic?
https://world.optimizely.com/forum/developer-forum/CMS/Thread-Container/2019/3/access-rights-for-properties/

2. You can override the content save/publish event in Optimizely and trigger an API call. I can't say it's best practice, but it's the first thing that came to my mind.
Maybe this one can give some inspiration?
https://world.optimizely.com/blogs/Daniel-Ovaska/Dates/2019/6/content-events-in-episerver/

3.
- Documentation on how indexing works:
https://docs.developers.optimizely.com/content-management-system/v1.1.0-search-and-navigation/docs/indexing-search-and-navigation

- Depending on how you have configured sitemap, you might be able to exclude all contents that have a true boolean on ExclusiveNews, when you generate the sitemap.

- Just do the same with Robots.txt, exclude all the content that you don't want to be crawled.


4. I can't see how it can be exposed in Content Search API if it's not in Optimizely Search & Navigation.

I hope my answers are good enough to point you to the right direction.


It worked!

#339638
Edited, Jul 11, 2025 20:14
Vote:
 

Hello Manoj,

You can use a custom editor decriptor to validate the user's access to a property and otherwise hide it.  This is re-evaluated on page load:

    [EditorDescriptorRegistration(TargetType = typeof(string), EditorDescriptorBehavior = EditorDescriptorBehavior.Default)]
    public class RestrictedStringPropertyEditorDescriptor : EditorDescriptor
    {
        public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
        {
            base.ModifyMetadata(metadata, attributes);

            if (!string.IsNullOrWhiteSpace(metadata.PropertyName) && metadata.PropertyName.Contains("RestrictedFieldName"))
            {
                var canAccessField = // Add your user evaluation here

                metadata.ShowForEdit = canAccessField;
            }
        }
    }
#339775
Jul 21, 2025 9:20
Vote:
 

Hi Manoj,

I think you can follow this article and tweak it based on your needs
https://world.optimizely.com/blogs/tomek-juranek/dates/2025/4/block-thumbnail-based-on-website-on-multisite-solution/

 

#339834
Jul 30, 2025 17:59
Vote:
 

Thank you, Mikael, Mark, and Ravindra, for your valuable inputs and suggestions.

After further evaluation, we decided to revise our initial approach, as it became increasingly complex with the addition of new requirements. To simplify the solution and improve maintainability, we introduced two dedicated block types: Exclusive News and Exclusive Events.

These blocks are designed to operate independently and will not be integrated directly into any existing pages. Instead, they will be exposed via API and dynamically combined with the existing News and Events content. 

#342806
Jun 16, 2026 14:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.