ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Outbrain rating widget - permalink and javascript

June 20, 2009 1:15pm

Subscribe [2]
  • #1 / Jun 20, 2009 1:15pm

    ollym

    17 posts

    The outbrain content rating widget allows visitors to your site to rate content and find other related content they will enjoy. This increases user engagement and hopefully pushes up PIs per visit.

    I’ve tried to install outbrain on my site http://www.teentoday.co.uk and although I can get it to work, for it to fully function I need to pull in a permalink to the current article’s location.

    This is the code. Am I able to pull in the article’s permalink in the relevant place. I wasn’t sure how this works because it sits with in the javascript code.

    Update: after posting the code I’ve realised the EE message board system blocks javascript.. but to clarify the code sits between <s.c.r.i.p.t> tags.

    [removed]
        var OutbrainPermaLink='DROP_PERMALINK_HERE';
        var OB_demoMode = false;
        var OB_langJS ='http://widgets.outbrain.com/lang_en.js';
        if ( typeof(OB_Script)!='undefined' )
            OutbrainStart();
        else {
            var OB_Script = true;
            var str = '[removed]<\/script>';
            [removed](str);
        }
        [removed]
  • #2 / Jun 24, 2009 1:24pm

    ollym

    17 posts

    Sorry to bump this - but does anyone know how to generate a permalink within javascript in EE?

  • #3 / Jun 24, 2009 1:52pm

    Gareth Davies

    491 posts

    Assuming it’s within a set of EE weblog entries tags it works just the same so (obviously replace news/article to wherever your article template is):

    <removed>
        var OutbrainPermaLink='{title_permalink="/news/article/"}';
        var OB_demoMode = false;
        var OB_langJS ='http://widgets.outbrain.com/lang_en.js';
        if ( typeof(OB_Script)!='undefined' )
            OutbrainStart();
        else {
            var OB_Script = true;
            var str = '[removed]<\/script>';
            [removed](str);
        }
        </removed>
  • #4 / Jun 24, 2009 5:58pm

    ollym

    17 posts

    Thanks, this seems to have done the trick. If you’d like to see it in action on Expression Engine, see here:

    http://www.teentoday.co.uk/article/teen-ratings/

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases