Make an editable 'copyright' section for your client
on 28-Feb-2010 | Comments ( 6 ) Tags: Evolution, GetField
The solution will not require the client to know what a chunk is. I usually set up generic configurations as a TV for the home page.
Create the TV
Create a new TV called copyright and assign it to the home template. You can choose Text, Textarea or Rich Textarea as input type.
As a default value use the example below:
© YourSite 2009-[[GetCurrentYear]]
Create snippet to get the current year
Create a new snippet called GetCurrentYear and paste the code below:
<?php
return date("Y");
?>
Show the TV value in all your templates
In order to display the value of the copyright TV you have to install a snippet like GetField.
Use it in your templates like:
[[GetField? &docid=`1` &field=`copyright`]]
modxRules uses this method. As an example check the copyright information present in the footer of this page.

Write a comment
Posts: 4
Reply #6 on : Fri April 09, 2010, 20:47:25
Posts: 2
Reply #5 on : Fri April 09, 2010, 22:16:58
Posts: 4
Reply #4 on : Thu April 22, 2010, 04:27:00
Posts: 2
Reply #3 on : Thu April 22, 2010, 06:02:28
Posts: 4
Reply #2 on : Mon May 10, 2010, 16:42:51
Posts: 4
Reply #1 on : Mon May 17, 2010, 13:07:44