How to Add a SideBar in Pligg

Pligg is an open source CMS that allows you to create a site similar to Digg. In all my Pligg sites, I wanted to add a side-bar or “side-panel” to contain a small list of links to other of my own websites for SEO optimation (backlinks). It’s fairly painless, you have to edit one file and create one new file and edit it. The following was done in Release 1.1.5. (Note: the side-bar will display on every page of your PLIGG site, not just the home page). But, if you want to get going click, skip to the shortcut at the bottom.

Step 1 – Copy about_box.tpl to custom.tpl

Copy templates\wistie\sidebar_modules\about_box.tpl to custom.tpl
NOTE: Do this in whatever theme/template you are using. The default theme is “wistie”.
Change the file to more-or-less match the following. You put the title of your side-bar where I have the word “Recommended”, and you put your content where I have “put your content here” (which could be a series of links). I have shown this in italics below.

<!-- START CUSTOM -->
           <div class="headline">
               <div class="sectiontitle">Recommended</div>
           </div>
           <div id="aboutcontent">
                 <!-- put your content here --> 
                  <a target="_blank" 
                    href="http://ConsistentIncomeFromTrading.com">
                    Stock Trading Systems</a>
                 <!-- end of your content here --> 
           </div>
<!-- END CUSTOM --> 

Step 2 – Edit sidebar.tpl

Now go up a level in the directory structure, and modify: Pligg_1_1_5\pligg\templates\wistie\sidebar.tpl.
Find the literal “about_box”. Copy the “START ABOUT” section after itself, and call your new section “START CUSTOM”. Change one thing only; change from value=”about_box” to value=”custom”.

<!-- START ABOUT -->
		{assign var=sidebar_module value="about_box"}
{include file=$the_template_sidebar_modules."/wrapper.tpl"}
	<!-- END ABOUT -->
	<!-- START CUSTOM -->
		{assign var=sidebar_module value="custom"}
{include file=$the_template_sidebar_modules."/wrapper.tpl"}
	<!-- END CUSTOM -->

Step 3 – Result

Pligg uses a nice system called “Smarty Templates” which allows separation of code from presentation (the html/graphics, etc…). So the .tpl files above are templates.

The Shortcut

There is actually another twist to the above. If you just want to add a few links, and don’t need to create multiple side-panels, then you can just modify the “about_box.tpl”. Every default Pligg install has a rather gratuitious advertisement for Pligg itself in the right sidebar.
Simply edit templates\wistie\sidebar_modules\about_box.tpl. Change the box name (called the sectiontitle) and put in your own contents. This forum discussion shows how to remove the “About Pligg” box: Amoxil

I changed the sectiontitle to “Attention” and copied a link to a Clickbank product into the “aboutcontent” section.

<!-- START ABOUT -->
        	<div class="headline">
            	<div class="sectiontitle">Attention!</a></div>
            </div>
            {checkActionsTpl location="tpl_widget_about_start"}
            <div id="aboutcontent">
<a href="http://walters.eitrader.hop.clickbank.net/?tid=501">
<img src="http://eliteinsidetrader.com/wp-content/themes/newspress/images/125x125_explosive_stocks.gif" alt="" width="125" height="125"/></a>
            </div>
<!-- END ABOUT -->

For more information, see this blog: http://www.upstartblogger.com/understanding-pligg-template-files.


Leave a Reply

 

Filme Porno Filme Porno Romanesti Ponturi Bune Divertisment si Stiri