This applies to: 2.5.x (steps may slightly differ for 3.0.x and later)
High-Level Summary: There are remnants of code in Clearspace that will allow you to expose signatures through the theme layer. To get it to work properly, you will need to alter the source code (and require some ingenius design and FTL manipulation). This document was based on this thread. Note: The methods called in these theme changes are not regularly tested or a part of our QA checks, so this theme customization is unsupported. If you have an issue and Support deems that this is a part of the issue, we will ask you to remove the customization.
This document assumes you have a basic knowledge of themes. You can read more about themes here.
First, you'll want to edit the /template/global/edit-profile.ftl template. The code will be very similar to how the email or name fields are implemented, with signature and showSignature as our input fields (as opposed to email and showEmail). My particular code looks like this:
<tr>
<td class="jive-table-cell-label jive-label-required">
<label for="sig01">
Signature:
</label>
</td>
<td>
<input type="textarea" name="signature" size="20,5" maxlength="250" id="sig01" value="${signature?default('')!?html}" />
<br />
<input type="radio" name="showSignature" value="true" id="sv01" <#if targetUser.properties["jiveSignatureVisible"]?exists && targetUser.properties["jiveSignatureVisible"] == "true">checked="checked"</#if> />
<#-- Show -->
<label for="sv01" class="jive-profile-edit-secondary"><@s.text name="global.show"/></label>
<input type="radio" name="showSignature" value="false" id="sv02" <#if !(targetUser.properties["jiveSignatureVisible"]?exists) || targetUser.properties["jiveSignatureVisible"] == "false">checked="checked"</#if> />
<#-- Hide -->
<label for="sv02" class="jive-profile-edit-secondary"><@s.text name="global.hide"/></label>
<@macroFieldErrors name="signature"/>
</td>
</tr>
(In the case of the radio buttons, no signature variables exist in the User object, so I had to hack the FTL a little to check the user properties for the jiveSignatureVisible property...you'll see more of this below).
This will result in:
You'll now need to modify the /template/global/forums/thread.ftl. There are two areas where you'll need to add this code: for the opening message and in the reply:
<#if message.user.properties["jiveSignatureVisible"]?exists && message.user.properties["jiveSignatureVisible"] == "true">
${message.user.properties["jiveSignature"]?html}
</#if>
In this case, I've escaped the HTML of the signature in case anyone tries to create a malicious signature (i.e. an open DIV tag). It will look like this:
I think this is a good idea. Is this an enhancement request?
I'm not seeing /template/global/forums/thread.ftl.... I am seeing /template/forums/thread.ftl Anyone happen to know what line is best to insert the <if> statements in?
I've got it displaying properly in edit-profile.ftl Not so successful in thread.ftl though. The signature displays though it always appears right after the Date in response to: username and before the subject.
I'd like it to appear right after the text I enter. Also I'd like to have at least three lines. One for Name, One for Title and one for a sentence about asking users to mark responses as Correct or Helpful Answer.
Anyone else want to see a HTML signature?
Mark
cool.