Skype Your Profile: A Quick and Dirty Theme

    This applies to: 2.5.x (steps may slightly differ for other versions)

     

    High-Level Summary: This is a quick theme change that will show a user's Skype status in their profile field. There are definitely better ways to do this, but this will give you a nice starting point on a better implementation.

     

    This document assumes you have a basic knowledge of themes. You can read more about themes here.

     

    There's a Skype in my Clearspace

     

    The first step is to create a custom text field for your profile and choose a label. Mine was 'Skype':

     

    skype1.png

    Now you need to create a theme and overwrite the /template/global/include/profile-macros.ftl. You'll see this section of code at the very bottom of the file:

     

    <#if fieldValue.value?exists>
            ${fieldValue.value?html}
    <#elseif fieldValue.values?has_content>
            <#list fieldValue.values as val><#if (val_index != 0)>, </#if>${val?html}</#list>
    <#else>
            <@s.text name="profile.na.text" />
    </#if>
    

     

     

    You'll want to change it to something like this:

     

    <#if fieldValue.value?exists>
         <#if field.name == "Skype">
              <img src="http://mystatus.skype.com/smallclassic/${fieldValue.value?html}"/>
         <#else>
              ${fieldValue.value?html}
         </#if>
    <#elseif fieldValue.values?has_content>
         <#list fieldValue.values as val><#if (val_index != 0)>, </#if>${val?html}</#list>
    <#else>
         <@s.text name="profile.na.text" />
    </#if>
    

     

     

    Since name of my field was Skype, that's what I placed in <#if field.name == "Skype">. Yours would look similar, but with your own field name hard-coded in.

     

    When you've saved the template and set your theme, your profile page should now look like this:

     

    skype2.png