Discussions

    Search Discussion
    Most Recent Posts
    Our Site Interface discussion is intended for technical users who are manipulating the Header/Footer, XSLT, CSS, etc. within their instance  
    View All TopicsSubscribePost a Topic or Question
    113 Posts
    Replacing Thumbs Up/Down with the Like button
    By cameron   
    It was requested that I write up a summary of how to upgrade, so-to-speak, from the thumbs up/down function to the Like emitter. This "tutorial" assumes you know how to edit templates from the Admin panel of your community.

    First, there are a few templates that need to be changed based on whether or not you wish to replace ALL the instances of thumbs up/down or just a select few. The two main templates that I have chosen are the social space public profile (System Modules -> Social Object – SOInfoShort.xslt) and the social object photos (System Pages -> Photos 2.0 – Album Photo Permalink; photo.xslt). This will allow users to Like social spaces and their photos.

    In both templates you must make sure to include:
    xsl:include href="/Extension/iSetLikeHandler.xslt"/ (reformat this, I have broken the code so it will display as text in this tutorial)

    After that find the div for the thumbs up/down ( xsl:value-of select="iPageInformation:RenderTUTDRating. Etc.) and either delete or comment it out. I prefer to comment out so you don’t lose anything. Then add the following code:

    xsl:call-template name="EmitLike"
    xsl:with-param name="oObject" select="$oPhoto/Photo" /
    /xsl:call-template
    (again reformat this with < > so it will work)

    That bit is specific to the photo.xslt template.

    For the social object module, replace the select value with “$oSOBase/SocialObjectBase” after commenting out the div with the same thumbs up/down code as the photos.

    There are a lot of conditionals in the SOInfoShort module compared to the photos, but ignore them and just find the right div. That should do it!  As far as I can tell you can add this EmitLike button to a variety of objects as long as you include the template and change the select value to that of the object you are modifying. Voila!
    Categories:  Global XSLT Functions
    ReplyRemoveEditUnsubscribeSubscribe

    Visit TJ Muehleman's profile
    42 Posts
    TJ Muehleman  says:
    Great write-up! Thanks so much for taking the time to put it together. 
    Posted:   
    TJ Muehleman - VP Technology

    www.twitter.com/theportlabs 
    Block signature
    ReplyDirect LinkRemoveEdit