Kamloops Website Design, Kamloops Website Development and Kamloops Website Hosting - Adroit Technologies (ATWS)

 

How to correct the copyright year in ModX's Ditto RSS Feed Builder

 

The ModX CMS provides a great plugin called Ditto. Ditto allows a web designer to quickly summarize web pages (documents) and display the summarizations in customized formats such as in a Blog, an RSS feed or even a sitemap.

While creating this website in the ModX CMS, we decided to implement an RSS feed for this Blog and discovered that we could implement it quickly and correctly with the Ditto plugin that was bundled with the installation of ModX.

I setup the call to Ditto as follows:

[ [Ditto ? &parents=`2` &format=`rss` &display=`20` &total=`20` &removeChunk=`Comments`] ]

With the default installation, this worked quite nicely; but after reviewing the output, the copyright tag was displaying the wrong year--2006.

After some hunting through the code, I determined that there are two ways to fix the problem.

Method 1

The internal code for Ditto attempts to use the PHP variable called $copyright. If this variable does not exist, it will default the copyright year to 2006. What a user can do is create a new Snippet that creates a $copyright variable and sets it to a year then calls Ditto.

Method 2

This method will allow for the copyright year to always remain up to date but it depends on the site's language. What you will need to do is find the language file that your site uses and change it there. For example, if your site uses English, you will be looking for the english.inc.php file in [install_location]/assets/snippets/ditto/lang/. For this file, on line 42, you will find the following line: $_lang['default_copyright'] = "Web Design | Website Development 2006"; For our installation, I changed it to the following: $_lang['default_copyright'] = "Web Design | Website Development ".date("Y",time()); This will return the server's year portion as YYYY.

I originally left this as a solution on devcomments.com but I feel that additional clarity will help improve this situation.

Recent Entries

Site Migration Series (3 of 5)
How to Migrate your Website

Site Migration Series (2 of 5)
How to Migrate your Website

Site Migration Series (1 of 5)
How to Migrate your Website

Use Google Page Speed to speedtest your website.
Use Google Page Speed to check the speed of your website, focusing on DNS and other common issues

ModX Ditto RSS - Wrong Copyright Year
How to correct the copyright year in ModX's Ditto RSS Feed Builder

Archives

 

Recent Work

View our work portfolio

Learn about us

Discover Adroit Technologies

Our Services

Services matching your needs

Read our blog

Follow our latest news