Custom Components Not Rendering Properly

After much searching, I have finally figured out what was causing two frustrating issues I have run into several times and thought I would share it with everyone. Both issues involve creating a Custom Component that includes HTML.

If you use an iframe tag to reference an existing Visualforce page and do not include a certain switch in your URL, the component will not be rendered properly and instead of seeing the rendered Visualforce page, you will just see code in the area where your custom component should be (see top left home component of image below)


To avoid this issue, you must add a parameter to the url attribute for your iframe tag. For example, the component titled, Case Count By Status was referencing a Visualforce page named CasesSidebar using an iframe tag. Instead of using src attribute that looks like the following:


you will need to include a switch after the page name called isdtp. The src attribute should instead look like the following:


A second issue involves how you enter the HTML for your custom component. If you are not careful about how the HTML is entered, your component will end up displaying the actual HTML code and not the rendered result. For example, if you were to add a Custom Component to the Home page by going to Setup | Customize | Home | Home Page Components and clicking New, you will be brought to a page that looks like the following:


If you were to start entering HTML code into the editor below and THEN click Show HTML, you will have a problem when the component renders. Instead of displaying the rendered iframe, you will just see the iframe HTML where your component should be.CustomComponentsShot3

You MUST click the Show HTML checkbox BEFORE you type or paste any code into the editor area. I personally think this is a bug and it should not matter when you click the Show HTML checkbox, as long as you do so before clicking Save.

Perhaps Salesforce will fix this at some point in the future, but in the meantime, I wanted to post this and hopefully it will be found by someone encountering the same issue.

1 Comment

Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s