Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Adding the date to Meta Description

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-26-2011, 05:09 AM
 
xcart-dev xcart-dev is offline
 

Advanced Member
  
Join Date: Jun 2011
Posts: 59
 

Default 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?
__________________
X-Cart 4.4.3
Reply With Quote
  #2  
Old 06-26-2011, 09:02 AM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 758
 

Default 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
Reply With Quote
  #3  
Old 06-26-2011, 10:46 AM
 
xcart-dev xcart-dev is offline
 

Advanced Member
  
Join Date: Jun 2011
Posts: 59
 

Default 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 ....
__________________
X-Cart 4.4.3
Reply With Quote
  #4  
Old 06-26-2011, 12:37 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 06-26-2011, 10:30 PM
 
xcart-dev xcart-dev is offline
 

Advanced Member
  
Join Date: Jun 2011
Posts: 59
 

Default 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!
__________________
X-Cart 4.4.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020