We Provide progressive business solutions

Researchg

Web Content Management Systems
A universal interface to connect to and manage any content management system.

solutions

Consolidating Control Panel Interfaces
Designing one interface to connect through the APIs of disparate content management systems

Results

Extending Core Applications
Every CMS has it's own way of doing things. A place to organize the different ways to do things in different types of content management systems.

Navigation

Login

How to do it...

  1. Create a Chunk to include the following code.
<iframe id=”facebook_like_btn” src="http://www.facebook.com/widgets/like.php?href=http://mysite.com"
        scrolling="no" frameborder="0"
        style="border:none; width:450px; height:80px"></iframe>

    
  1. Write a script to update this value to reflect the current page location. Include this script with the Chunk code above.

Function dynShareLink() {

var url = window.location.hostname;

var newUrl = 'http://' + url;

var btn = document.getElementById('facebook_like_btn');

var str = btn.getAttribute('src');

var old = str.split('=')[1];

var newStr = str.replace(old,newUrl);

btn.setAttribute('href',newStr); };

  1. Create a new Plugin in the Manager. Go to the System Events tab and select OnWebPagePrerender. For the Plugin, include the following code.

<?php echo ‘<script>dynShareLink()</script>’ ;

How it works...

The short script will update the appended value in the src attribute of the iframe element. The plugin will call this function before the page renders, updating the value of the src attribute. This will tell the browser to update the code, and share the current page on facebook.