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
barbkuntzbarbkuntz 

Sites converting <!--….--!>

We are having our Sites-based website translated into 3 new languages.  As part of the process, we are adding directive tags <!--….--!> to tell the translator robots what to do with certain pieces of information.  The trouble is, Salesforce.com is changing the text between those tags to asterisks <!--*****--!> which renders them unreadable.  How can I keep Salesforce from doing this?

Best Answer chosen by Admin (Salesforce Developers) 
barbkuntzbarbkuntz

Well, that little hack didn't work, but I did finally get a solution from Salesforce support which may also help some of you.  Good luck!

 

++++++++++++++++++++++++++++++++++++++

 

1). Create a custom label with a param for the text in the label:

<labels>
<fullName>SourceCommentLabel</fullName>
<language>en_US</language>
<protected>true</protected>
<shortDescription>Label that allows you to include comments in the rendered source.</shortDescription>
<value>&lt;!-- {0} --&gt;</value>
</labels>

2). Use apex:outputText tag to include a comment:

<apex:outputText escape="false" value="{!$Label.SourceCommentLabel}">
<apex:param value="mp_trans_disable_start"/> </apex:outputText>

 

 

All Answers

paul-lmipaul-lmi
if you figure this out, i'd love to know how. we wanted to use the same logic to keep informational/debugging comments in the final output.
Greg LovelidgeGreg Lovelidge

This is a huge need for Sites.  No conditional comments support.

sfdcfoxsfdcfox

I'm willing to bet it's a "protection" feature so your secrets are not leaked to the world. Clever of them, if you ask me. Anyways, you're not interested in that, so I'll cut to the chase. Here is a "hack" I've found that appears to work. At least, until they fix it.

 

 

    <apex:outputText escape="false" value="<"/>
    <apex:outputText escape="false" value="!-- some dirty secrets here -->"/>

 

 

barbkuntzbarbkuntz

Thanks - we'll give this a try.  I'll let you know how it turns out.

barbkuntzbarbkuntz

Well, that little hack didn't work, but I did finally get a solution from Salesforce support which may also help some of you.  Good luck!

 

++++++++++++++++++++++++++++++++++++++

 

1). Create a custom label with a param for the text in the label:

<labels>
<fullName>SourceCommentLabel</fullName>
<language>en_US</language>
<protected>true</protected>
<shortDescription>Label that allows you to include comments in the rendered source.</shortDescription>
<value>&lt;!-- {0} --&gt;</value>
</labels>

2). Use apex:outputText tag to include a comment:

<apex:outputText escape="false" value="{!$Label.SourceCommentLabel}">
<apex:param value="mp_trans_disable_start"/> </apex:outputText>

 

 

This was selected as the best answer