0

I would need some help regarding creating a custom toolbar for PayloadCMS RTE.

The current version is PayloadCMS 3.49.1, and linked with @payloadcms/richtext-lexical version of 0.28.0.

My goal is to create an ordered list using alphabetical and roman numerals.

I have tried to upgrade the version to 3.55.1, but without any result.

Can I use the current version of 3.49.1 to create the custom toolbars?

This is my current code

import {
  FixedToolbarFeature,
  HeadingFeature,
  InlineToolbarFeature,
  lexicalEditor,
  BlocksFeature,
  TextStateFeature,
  defaultColors,
} from '@payloadcms/richtext-lexical'

import { Banner } from '@/blocks/Banner/config'
import { Content } from '@/blocks/Content/config'

export const customFeature = (defaultFeatures: any) => {
  return [
    ...defaultFeatures.filter(
      (feature: any) => !['inlineCode', 'checklist', 'blockquote'].includes(feature.key),
    ),
    FixedToolbarFeature(),
    BlocksFeature({
      blocks: [Banner, Content],
    }),
    TextStateFeature(),
  ]
}
1
  • i have followed your steps, but I'm getting an error during registering the custom toolbars in the function. createClientFeature({ key: 'custom-list-buttons', clientFeature: { ToolbarComponent: CustomListButton, }, }), Commented Sep 18 at 1:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.