My Narrow component not working on Communities . it give a site under construction page. Current iFrame in the home page widget VF is like the following:

<iframe  ="" src="/apex/HelloWorld?isdtp=1" scrolling="no" frameborder="0" width="200px" style="min-height:320px;max-height:400px;"  id="myFrame"  onload="sizeFrame('myFrame')" id="mmFrameId_0.050366452895104885"></iframe>

what is the solution to give the Relative url of my visual page? and Is there anyway to find out if the user is in community or not using html/javascript in homepage component code.?

1 Answer 1


You cannot give a relative URL in this fashion. To display VF pages by injecting via iframe in home page component you need to have to construct the URL in this way


Also other things to take care is, if you have any links in the VF pages where you have given the links like /apex/pageName will not work in community. You can make these dynamic by using the global variable $site.prefix also you can access the site prefix in apex code site.getPrefix() method in case you are using pagereference for routing the users to other VF pages in community.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .