

Favorite Pligg Template?
Total Voters: 198
In today’s post I will be teaching you the basics for designing a Pligg template. I’ve designed about a dozen Pligg templates so far, and through those experiences I have compiled some quick tips for beginners wanting to create their first Pligg template. Before I dive into the details let me first mention that there is some existing documentation about Template Structure and Template files, which can be read on the Pligg Wiki. This article is a primer for Pligg template designers, and is by no means a good reference for advanced template techniques.
Pligg uses a variation of the Smarty template engine, called Template Lite. Smarty code requires special markup when you want to use Javascript, CSS or PHP code in your .tpl files. For Javascript and CSS you will need to begin the code with a {literal} tag and end it with {/literal} tags. For PHP code, you will need to replace the < ?php opening tags with {php} and the ?> closing tag with {/php}. Examples are provided below to demonstrate each of these languages being used in a Pligg .tpl file.
{literal}
<script type="text/javascript">
document.write("Hello World!");
</script>
{/literal}
A large number of new threads being created on the forums are by users who attempt to add javascript to their templates without knowing that they should use {literal} tags. If you have added javascript to a .tpl file and you see an error beginning with “Parse error: syntax error, unexpected ‘{‘ ” you more than likely forgot to wrap the javascript with {literal} tags.
{literal}
<style type="text/css">
.example {font-weight:bold;}
</style>
{/literal}
Beginners often overlook CSS files as a good first step for changing the style of your site. Many design projects could probably be completed by only editing the stylesheet file(s). I highly suggest that users start out modifying a Pligg template by tweaking the stylesheet file.
{php}
echo 'Hello World!";
{/php}
You can see more examples of using PHP in .tpl files in the Wiki article “PHP in Template Files“. I will occasionally write entire features into Pligg template files by using {php} tags, which should only be done for very simple {php} code, or when you don’t have time to create a module.
Most people who begin a Pligg template without any previous experience will probably feel a little intimidated by the number of .tpl files that Pligg uses. There are roughly 40 files to work with in the stock Pligg template(s). These files control every small detail that a designer might want to take advantage of, but don’t feel like you need to edit all of the files to achieve a unique looking template. You could probably customize just 5 template files and in no time at all your site will look radically different.
This template is the main “wrapper” for all other templates. It controls the main layout for the site and includes most of the data located in the
of the document. After you’ve finished changing your CSS the pligg.tpl file is the first template file that you should open up and explore.This template is usually used for navigation for the upcoming, published and submit pages. It is also used commonly to wrap the category, breadcrumb and search box.
As you can guess by the name, these two files are typically used for the sidebar content. It is divided up into two files should you want to have 2 sidebars or use the second sidebar in a more creative position like just before your footer. The sidebar will contain “sidebar widgets” which is what we call things like the “Top Today” or “Latest Comments” modules.
As you may have guessed by the name, footer.tpl controls the footer content on your website. This is normally used for credits, contact information and site links.
Last, but certainly not least is probably the most misunderstood template file for Pligg. Link_summary.tpl is responsible for styling the story data used by Pligg wherever the story appears. This includes the story data used on the story page, profile page, group page, upcoming page, or third submission step page. It holds the vote number and links, admin tools, story title, story description and a lot of other items. This is probably the most complicated template file to understand because there are so many features in it, but if you take ten minutes to carefully read the code you probably won’t struggle to pick up on how the template is laid out. Because this file deserves it’s own article I will not dive into every detail for this file, but I will emphasize the important features.
Read the rest of this entry »I wanted to demonstrate how quickly templates/themes from other CMSs could be converted to Pligg, so Friday afternoon I began work converting the WordPress theme Arthemia into Pligg. Since WordPress is probably the most widely used CMS it seemed like a perfect candidate to show off how easy making templates for Pligg can be. After about 24 hours I ended up with not only a new template for Pligg, but also a module to go with it.
The Featured module was based on CMStheme’s “Featurify” module. The original module was designed to have admins upload images to rotate through as a slideshow on a Pligg site. The images were linked to related stories and would display the story title and description as stored in the database. The module had a lot of features that were close to what I was looking for, so after a lot of hacking I got it to work as more of a featured story management tool than slideshow tool. View the embedded video above for a quick demonstration of both the module and template. Read the rest of this entry »
Pligg has made it to the final stages of voting for this year’s “Most Promising Open Source CMS” award. We are asking users to vote one last time for Pligg so that we can win both a cash and bragging rights from this year’s CMS Awards competition. There are a total of 5 candidates in the Most Promising category list including: