I've a lightning component which loads a visualforce page to load a video like below:

<iframe src="{! v.urlPrefix + '/video?Id=' + v.videoId }"/>

I get the urlPrefix from the component controller like below:

String communityId = Network.getNetworkId();
if (communityId != null) {
    if(ConnectApi.Communities.getCommunity(communityId) != null && ConnectApi.Communities.getCommunity(communityId).urlPathPrefix != null) {
        return '/' + ConnectApi.Communities.getCommunity(communityId).urlPathPrefix;

return '/apex';

This works fine in Community & Out-side community but the same gives "Invalid Page" in Community Builder while building/editing the page.

Any suggestions.


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.