Thursday, November 14, 2024

Pages Rich Text Editor (RTE) Lacks Internal Sitecore Link Functionality

 We recently discovered that the Rich Text Editor (RTE) in Pages does not support creating internal Sitecore links. This limitation impacts the ability of the marketing team to easily add internal links directly from the Pages interface.


Current Status

Sitecore Support has confirmed that this functionality is not currently available in the Pages RTE.

  • A feature request (PGS-1236) has been created for consideration in future releases.
  • In the meantime, the recommended workaround is to add internal links directly through the Content Editor.

Workaround

For now, internal links can be added by:

  1. Navigating to the Content Editor.
  2. Editing the Rich Text field and manually inserting internal links.

Next Steps

  • Monitor the status of the feature request (PGS-1236) via the Sitecore Support portal.
  • Consider educating content authors on the temporary workaround until the feature is available in Pages.

We hope to see this functionality in upcoming releases to streamline the authoring experience for internal linking directly in Pages.

Wednesday, November 13, 2024

Custom Class Not Retained in Rich Text Editor (RTE) in Page Editor Mode (XMCloud)

We encountered an issue with the Rich Text Editor (RTE) in the Page Editor of Sitecore XM Cloud. When attempting to add a custom class attribute to an HTML element (e.g., <span>), the custom code is not retained upon saving and reopening the RTE. Instead, the code is converted into a <p> tag, stripping the custom class.

Example:

Input:


<span class="small-text">Sample Text</span>

After saving and reopening:


<p>Sample Text</p>

Investigation and Findings

  • The issue occurs exclusively in Pages' RTE, which uses Quill.js as the editor.
  • In the Content Editor's RTE, custom attributes like <span> and class are preserved as expected.
  • This behavior is linked to Quill's optimization process, which standardizes and simplifies HTML during editing.

Recommended Resolution

To address this issue, Sitecore Support recommends switching to the latest CKEditor RTE, which resolves the problem and supports retaining custom attributes like classes.


Steps to Enable CKEditor in Sitecore XM Cloud

  1. Update Configuration:

    • Replace Quill.js with CKEditor as the default Rich Text Editor for the Page Editor.
  2. Validate Custom HTML:

    • Ensure that CKEditor preserves custom HTML elements and attributes in your environment.
  3. Test and Deploy:

    • Test the new RTE configuration thoroughly in a staging environment before rolling it out to production.

For detailed instructions, refer to the official Sitecore documentation: Enabling CKEditor in Sitecore XM Cloud.


Workaround

If switching to CKEditor is not immediately feasible, you can manage custom HTML via the Content Editor RTE, where the issue does not occur.


Outcome

By implementing CKEditor, you can retain custom classes and resolve this limitation in the Page Editor's RTE, ensuring better flexibility and alignment with custom styling requirements.

Tuesday, November 12, 2024

Sitecore API Pagination and Sorting Errors

 The Sitecore API was experiencing critical issues impacting pagination and sorting functionalities. Whenever users attempted to navigate to subsequent pages or apply sorting, the API returned internal server errors (500), rendering the features unusable.




Issue Summary

  1. Internal Server Errors (500):
    When pagination or sorting requests were sent, the API intermittently responded with:



    { "widgets": [ { "rfk_id": "test_widget_1", "type": "content_grid", "errors": [ { "message": "Internal Server Error", "code": 1001, "type": "internal_server_error", "severity": "HIGH" } ] } ] }
  2. Sorting Failures:
    Sorting configurations such as title_asc_asc or title_desc_desc failed to produce expected results. Responses either returned incorrect data or triggered the same server error.

  3. Inconsistent Pagination Behavior:
    For example, attempting to navigate to page 2 through /search?page=2 consistently produced the following:


    { "message": "Internal Server Error", "code": 1001, "type": "internal_server_error" }

Root Cause (Identified by Sitecore Team)

The Sitecore support team determined that the issue was caused by:

  1. A combination of boost rules and pagination settings that conflicted under certain API configurations.
  2. Faulty API handling logic when fetching large datasets while applying custom sorting and pagination rules.

Resolution

  1. System Update:
    Sitecore implemented a patch to rectify how boost rules interact with pagination requests.
  2. Configuration Adjustments:
    The team updated internal settings to ensure sorting worked seamlessly with pagination.
  3. Verification:
    After the fix was deployed, multiple test cases were executed to confirm that:
    • Pagination worked correctly.
    • Sorting options applied accurately without triggering server errors.