function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mcrosbymcrosby 

Hide Home Page Custom Component Name?

I have created a few custom components for the home page and was wondering if there is an easy way to hide the name of the component when it is displayed?  It appears that SFDC takes the name of the custom component and puts it in a h2 tag. 

I'm thinking I can write some JavaScript to locate the specific h2 tags I want to hide (clearing out the innerHTML) and embed that in the "Messages and Alerts" component, but I wanted to see if there was a better way to accomplish this.  Any suggestions?
Best Answer chosen by Admin (Salesforce Developers) 
SoloSolo

Hi there!

 

Add following cod at the end of your custom HTML code - this will hide H2 tag

<style type="text/css">
h2 {
display:none !important;
}
</style>

All Answers

bob17bob17
Did anyone ever figure this out?  I have the same issue.  Want to make the custom component look just like the native components but component name added by SF is preventing that.
MSSBMeghanMSSBMeghan
Anyone?  I'm hitting up against the same issue, too.  Would most appreciate any help!
SoloSolo

Hi there!

 

Add following cod at the end of your custom HTML code - this will hide H2 tag

<style type="text/css">
h2 {
display:none !important;
}
</style>

This was selected as the best answer
bob17bob17

Heads up folks, redefining the <h2> tag in the new user interface will hide other components on the home page like the Search and Recent Items headers. 

 

SF also seems to have picked the incorrect h tag for custom home page components.  Custom component headers are rendered between <h2> tags while standard component headers use the <h3> tag.  This makes custom components look really foreign on the home page.  Opened a case with support hoping this is seen as a bug.