I'm creating an LWC that the user can add to a community page, and I want them to set a relatively long text before publishing it.

There are 2 ways I can think about, but I have some issues:

  1. The customer will add a PDF to the Salesforce CMS, and I added targetConfig of type ContentReference to the js-meta.xml file:
<targetConfig targets="lightningCommunity__Default">
    <property type="ContentReference" name="contentId" label="Content ID" />

The customer selects the PDF when configuring the page, and I use the id to display it.

The problem: when I try displaying the file with /sfc/servlet.shepherd/version/download/{contentID}, the page displays an error instead - top.location='https://[my org]/ex/errorduringprocessing.jsp'

  1. Adding targetConfig of type String to the js-meta.xml file:
<targetConfig targets="lightningCommunity__Default">
    <property name="longText" type="String" default="Long Text" label="Long Text" />

The problem: the box showed to the customer is of one line, not at all suitable to the purpose. Also not rich text.

Is there a targetConfig of rich text? Is there another way to achieve this? Or do you know why my CMS content is not displaying?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.