Hi,
I’m trying to get a valid W3C date for google sitemaps. I’m using a custom query instead of “normal” exp:weblog:entries tag (this way I don’t get error messaged because of thousands of entries).
So, here is my code:
{exp:query sql="SELECT exp_weblog_titles.title as title,
DATE_FORMAT(FROM_UNIXTIME(exp_weblog_titles.edit_date), '%Y-%m-%dT%H:%i:%s%Q') as date_formatted,
exp_weblog_titles.entry_id as entry_id,
exp_weblog_titles.url_title as url_title,
exp_weblog_data.field_id_67 as iata
FROM exp_weblog_titles
LEFT JOIN exp_weblog_data
ON exp_weblog_titles.entry_id = exp_weblog_data.entry_id
WHERE exp_weblog_titles.weblog_id = '24'"}
<url>
<loc>{homepage}airports/{iata}</loc>
<lastmod>{date_formatted}</lastmod>
<changefreq>daily</changefreq>
0.7</priority>
</url>
{/exp:query}unfortunately this don’t work i.e. {date_formatted} is not processing and I get {date_formatted} as a raw text instead of a query result. Please advise, thanks.