Forum Discussion

twitchee27's avatar
13 years ago

Editing Standard Components

I want to edit two standard components, specifically Recent Posts and Recent Solutions, to only display the post, and not the board it came from. How do I do that, since I cannot locate the code?

6 Replies

  • usually I hide parts of standard components in CSS. This means that I locate it in the HTML and set the "display" property to "none" for the class of that element. Sometimes this is tricky as one should only use elements with classes that have "lia-" as prefix. They lia- classes are guaranteed to be around in future releases of the platform.

  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    As chrigu suggested, styling via CSS is a great way to change the look and feel of standard components, including hiding undesired elements within the standard components.

     

    Unfortunately, it is not possible to edit the code of standard component like you would a custom component.

  • andyyu's avatar
    andyyu
    Contributor
    13 years ago

    Hi Adam,

     

    If the standard component cannot be modified, can I create a silimar custom component to the standard one which I suppose to edit or there is any other ways to achieve this? To be specific, there is a standard component called 'message-list' which I want to add the number of posts between the message title and the posted time as shown in attached screenshot.

     

     

    Thanks,

     

    Andy Yu


    modifyMessageList.jpg
  • VenkS's avatar
    VenkS
    Lithium Alumni (Retired)
    12 years ago

    HI Andy,

     

    Unfortunately there is no easy way to do this. Re-making a standard component isn't easy, especially something like 'message-list', which has a fair amount of message related data. There are two ways that I can think of that you could do this though:

     

    1) Create a custom component and add it to the page that contains the 'message-list' component. This component will contain jquery code that will look up each message id (by CSS or element id), then make the relevant REST API call to get the number of posts for that message. You can then display the count between the message title and the posted time using jquery and HTML/CSS. Please keep in mind though that this could slow down the page load time (depending on the number of messages on that page).

     

    2) The other way would be to contact Professional Services (or Support), I believe they have the ability to modify the order of the information displayed on the 'message-list' component. If you were to create a custom component that displays the number of posts for a message, they should be able to add that component into the order.

     

    If you need any help with either 1 or 2, just let me know!

  • andyyu's avatar
    andyyu
    Contributor
    12 years ago

    Thanks, Venk:)

     

    I wouldn't go with the first way since the performance issue you mentioned.

     

    With regarding to the second way, do you know how long it may take Professional Services to add that information on the 'message-list' component? Also, should I raise this request as a case (Sorry, I am still a newbie here)?

     

     

    Cheers,

     

    Andy Yu

  • VenkS's avatar
    VenkS
    Lithium Alumni (Retired)
    12 years ago

    You can either file a Salesforce ticket, email support@lithium.com, or contact your AM. Feel free to let them know that they can contact me if they need any help setting you up :smileyhappy:.