How to Upgrade Templates

Most Pligg updates require that you make at least a few changes to template files to maintain compatibility with the latest version. These changes are typically new features and bug fixes that need to manually be added to the template with new versions. A common question that we get from users is how they can update their template when upgrading their site so that their template will remain compatible with the latest version of Pligg. This post will guide you through the template upgrade process and demonstrates how easy it is to keep your template up to date whenever a new version of Pligg comes out.

Step 1: Download Pligg CMS

The first step is to download 2 Pligg CMS versions: the version that you are currently running, and the version that you will be upgrading to. You can find archived versions of Pligg CMS in the Current Version area in the Pligg Forums.

When you finish downloading the 2 versions of Pligg, extract them into 2 separate directories. In the following examples I will be using the directory “Pligg CMS 1.1.5” as the latest version of Pligg and the directory “Pligg CMS 1.1.4” for the version of Pligg that I currently have installed.

Step 2: Download & Install Winmerge

Winmerge is software that allows you to compare 2 text files side by side. It will automatically scan a document for any differences and will highlight any of those differences. It also makes it easy to copy over changes from one document to another. Once you have downloaded and installed Winmerge software, continue on to step 3.

Step 3: Compare Old Version to New

Next you will open up Winmerge and select open. This can be done by pressing Ctrl+O, or by clicking on the icon that looks like a yellow folder. Winmerge allows you to compare entire directories, or just single files. We will now be comparing the Wistie template directory from the old version of Pligg to the latest version.

For the left input field, select the Wistie directory from the older version of Pligg. In the example in the screenshot I have selected Pligg 1.1.4. The right input field should select the Wistie directory from the latest version of Pligg, which in the screenshot is version 1.1.5. Make sure that you check the box “Include Subfolders” so that all of the sub-directories are being compared. Once that is set, click on the “OK” button.

You will see a list of all of the files contained within the Wistie directory at this point. We’re going to quickly filter out the files that haven’t been changed since the previous version to make this list more manageable. To do this, sort the results by clicking on the “Comparison result” column header. After this click on the first “Text files are identical” result, and then find the last result with the same “Text files are identical” label and Shift+Left Click on it to highlight all of those results. Right click and select “Hide Items” to remove them from your view. You will repeat this process with all of the “Binary files are identical” results too.

The list of files should now be only files that have changed since the previous release. If you see any “Left only” results in the “Comparison result” column, that means that a file has been added to the template since the previous version. If you see “Right only” results that means that a file has been removed.

The next step is to compare the old files to the new one. Double click on any of the file names on the list to open the file comparison tool. This will open up a new tab and open a split-pane view. In the left pane will be the old version of Pligg, while on the right side is the new version. You will see highlighted lines whenever Winmerge detects a difference between two lines. This could be as insignificant as text indentation, so in some cases you may be able to ignore some of the highlighted lines. When you see a greyed out line, that represents a line that is missing from one of the files.

Step 4: Apply Changes to Your Own Template

From here you will need to locate all of the changes made to the Pligg template files. Usually Winmerge will go the extra mile and even highlight in-line differences making it easy to spot exact changes. Whenever you find one of these changes you will need to apply that change to your own template. Obviously there will be some more minor changes applied to Wistie for cosmetic purposes, so not every change may be necessary to port over to your own template. It should be easy for you to determine which changes are non-cosmetic.

When adding the changes to your own template it may take a little bit of investigation if your template differs significantly from Wistie. It shouldn’t take more than 15 minutes for most users to perform the upgrade once they become comfortable with Winmerge. That’s about it for upgrading your template. Usually there are only a handful of changes applied to Wistie with each upgrade so it shouldn’t take you very long to update your template once you have familiarized yourself with this process and the Winmerge software.

Share this post

3 thoughts on “How to Upgrade Templates

Comments are closed.