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
MillbotMillbot 

CMSForce Manage Multiple Sites / Homepages

I am utilizing CMSForce to build out a couple of sites on Force.com. CMSForce has been a great tool but how do you specify more than one homepage? I have multiple sites (different content) but if I click on a CMS page to enable it as the homepage - it becomes the homepage for all my CMSForce created sites (since you can only assign "Homepage" for your Active Site Home Page). I need to assign multiple homepages basically, I can't imagine you can only use CMSForce for just one site.
Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent

CMSForce home page queries the cmsfoce page records, find the one marked as home page and redirects the flow to the page?pageid=<page_record_id>

 

You can introduce a new custom field to store additional info and query based on that or you can create a new home page for each of your site with the following code

 

 

<apex:page action="{!URLFOR('/path/page?pageid=HomePageIDofthisSite')}"/>

 since the second approach requires you hard code the record id you will loose the ability of dynamically marking the home page

 

 

All Answers

BulentBulent

CMSForce home page queries the cmsfoce page records, find the one marked as home page and redirects the flow to the page?pageid=<page_record_id>

 

You can introduce a new custom field to store additional info and query based on that or you can create a new home page for each of your site with the following code

 

 

<apex:page action="{!URLFOR('/path/page?pageid=HomePageIDofthisSite')}"/>

 since the second approach requires you hard code the record id you will loose the ability of dynamically marking the home page

 

 

This was selected as the best answer
David VPDavid VP

This is a know limitation of CMSForce (in fact Bulent asked me the same question even before it got published).

You could adapt the code to make it 'multi-home page' or use the workaround suggested above.

MillbotMillbot

Thanks so much, that worked. I just had to tweak the code you provided from <apex:page action="{!URLFOR('/path/page?pageid=HomePageIDofthisSite')}"/> to <apex:page action="{!URLFOR('/path/page?pageid=HomePageIDofthisSite')}"> - it wouldn't let me save the page with /> at the end. I do appreciate the help.

SaraswatiSaraswati

Having the exact same problem.  Would you be able to specify for me how to create this new custom field or where to put in the code that you mentioned?  I am very new to this and not sure how to follow your recommendations.  Thanks!

 

Saraswati

SaraswatiSaraswati

Update:  So, I created a new custom field that is a checkbox to designate the page as the home page for one particular site.  How do I go about making cmsforce query that field before the other home page checkbox?  Can you be really specific?  Thanks!