Sitemap.xml - List the web pages of your site.
A sitemap is a file where you can list the web pages of your site to tell Google and other search engines about the organization of your site content. Search engine web crawlers like Googlebot read this file to more intelligently crawl your site. Also, your sitemap can provide valuable metadata associated with the pages you list in that sitemap: Metadata is information about a webpage, such as when the page was last updated, how often the page is changed, and the importance of the page relative to other URLs in the site.
This file must be put at the root. Use only static code.
{_{ // // Name: menu_sitemap_google // // Description: Permet de publier le menu sitemap google // // Parameters: none so far // use lg // // Version: 1.0 2014-08-02 08:49:42 laplante@sednove.com initial version // use lg; // Loop from the publish site_config2 = config(); site_config = sql(single:true,"select * from sn_configs"); menu_json = sql(single:true,wantarray:true,"select json from sn_menus where code = 'menu_sitemap_google'"); if menu_json.rows[0] eq '' then menu = []; else menu = unstringnify(menu_json.rows[0]); endif }_}{_{ for item in menu do menu_item = sql(single:true,"select * from sn_menus_items where uid = '?'", item.id); if menu_item.rows.active eq "yes" && menu_item.rows.type eq "page" then page = sql(single:true,"select * from ? where uid = '?'", menu_item.rows.table_name, menu_item.rows.uid_page); lg_fr = page.rows.folder_fr; lg_en = page.rows.folder_en; if page.nbrows == 1 then }_} {_{site_config.rows.url_prod;lg_fr.resub("/","");;if page.rows.page_fr ne 'index' then page.rows.page_fr; endif}_} {_{datetime(lg:"fr",date:page.rows.sn_mdate,format:"%FT%T+00:00")}_} daily 0.50 {_{ endif endif endfor // Active News FR/EN for news sql("SELECT * FROM sed_news WHERE active = 'yes'") do }_} {_{site_config.rows.url_prod;lg_en.resub("/","");;if page.rows.page_en ne 'index' then page.rows.page_en; endif}_} {_{datetime(lg:"en",date:page.rows.sn_mdate,format:"%FT%T+00:00")}_} daily 0.50 {_{site_config.rows.url_prod;"fr/news-item/"; news.rows.seo_fr;}_} {{datetime(lg:"fr",date:news.rows.sn_mdate,format:"%FT%T+00:00")}} {_{ endfor // Active Events FR/EN for event sql("SELECT * FROM sed_event WHERE active = 'yes'") do }_} {_{site_config.rows.url_prod;"en/news-item/"; news.rows.seo_en;}_} {_{datetime(lg:"en",date:news.rows.sn_mdate,format:"%FT%T+00:00")}_} {{site_config.rows.url_prod;"fr/calendar-details/"; event.rows.seo_fr;}} {{datetime(lg:"fr",date:event.rows.sn_mdate,format:"%FT%T+00:00")}} {_{ endfor}_} {{site_config.rows.url_prod;"en/calendar-details/"; event.rows.seo_en;}} {{datetime(lg:"en",date:event.rows.sn_mdate,format:"%FT%T+00:00")}}
Written by Pascale Dewingaerde
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
1.0 2014-09-09 21:24:14 laplante@sednove.com