Saturday, 11 January 2014

Add thumbnail in pages - PyroCMS

For adding thumbnail in Pyrocms page....

Simple add a img tag in every page content page body


<img src="URL OF YOUR IMAGE" id="headerimg" style="display:none;" class="" alt="" title=""/>

Now add this javascript in your default.html under addons > themes > layout.

var headerimage = document.getElementById("headerimg").src;
window.onload = function() {
       //when the document is finished loading, replace everything
       //between the <a ...> </a> tags with the value of splitText



And finally add an image tag where you want to display your banner image.i used it in main.html under addons > themes > partials.

like this :
<img id="myLink" src="">

For demo


No comments:

Post a Comment