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
AndreaTAndreaT 

Managing specific site-related content in a shared visualforce page

Hello,

I manage several sites and some visualforce page is shared.

Since in every site there's need for specific, targeted content, e.g.. the footers, I put some code like:

 

<c:EGHomepagetitle rendered="{!$Site.Name = 'Egitto'}" />
<c:LYHomepagetitle rendered="{!$Site.Name = 'Libia'}" />

 

<c:ABCfooter rendered="{!$Site.Name = 'ABC'}" />

 <c:DEFfooter rendered="{!$Site.Name = 'DEF'}" />

 

Thus, I've references to components.

 

In order to manage pieces of codes in the main body,  is there any way to achieve the same result without any external reference?

 

I'd like to have a std visualforce page where some text&image are shown only when the page is used under a specific site.

 

Best Answer chosen by Admin (Salesforce Developers) 
AndreaTAndreaT

I found the solution:

 

 

<apex:outputPanel rendered="{!$Site.Name='XYZ'}">
</apex:outputPanel>

<apex:outputPanel rendered="{!$Site.Name='XYZ'}">

</apex:outputPanel>

 

 

thanks to a guy at salesforce.com

All Answers

RyanGuestRyanGuest

Have a look at the Site template option. I think it will do what you want.

AndreaTAndreaT

thanks.

 

Actually I've been using the <apex:composition> + <apex:define>.

Now I'd like to avoid increasing the number of components for smaller pieces of code.

AndreaTAndreaT

I found the solution:

 

 

<apex:outputPanel rendered="{!$Site.Name='XYZ'}">
</apex:outputPanel>

<apex:outputPanel rendered="{!$Site.Name='XYZ'}">

</apex:outputPanel>

 

 

thanks to a guy at salesforce.com

This was selected as the best answer