X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding the date to Meta Description (https://forum.x-cart.com/showthread.php?t=59950)

xcart-dev 06-26-2011 05:09 AM

Adding the date to Meta Description
 
Been searching for a simple answer for this one - I'm sure there is one!

In meta.pl there is the code

Code:

{meta type='description' page_type=$meta_page_type page_id=$meta_page_id}
Which generates the meta description.

Now I want to add the date (generated by php with something like

PHP Code:

echo date('jS M Y'); 

so I end up with
<meta name="description" content="4th July 2011 - [description for page from database]" />

Is there a way to do this in Smarty?

vasilis 06-26-2011 09:02 AM

Re: Adding the date to Meta Description
 
You might want to try the '{php}' and '{/php}' tags.
http://www.smarty.net/docsv2/en/language.function.php.tpl

xcart-dev 06-26-2011 10:46 AM

Re: Adding the date to Meta Description
 
Quote:

Originally Posted by vasilis
You might want to try the '{php}' and '{/php}' tags.
http://www.smarty.net/docsv2/en/language.function.php.tpl


I agree ... but where and how ....

cflsystems 06-26-2011 12:37 PM

Re: Adding the date to Meta Description
 
Using {php} tags in smarty is not recommended. Better modify /include/templater/plugins/function.meta.php to include whatever you want in the meta description

xcart-dev 06-26-2011 10:30 PM

Re: Adding the date to Meta Description
 
Quote:

Originally Posted by cflsystems
Using {php} tags in smarty is not recommended. Better modify /include/templater/plugins/function.meta.php to include whatever you want in the meta description

Perfect - worked a treat!


All times are GMT -8. The time now is 06:37 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.