Aller au contenu principal

Sitemap.xml

Sitemap.xml

NAME

Sitemap.xml - List the web pages of your site.

DESCRIPTION

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.

Example

{_{ 
	//
	// 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(table:"sed_site_lg",lg:"fr",date:page.rows.sn_mdate,format:"%FT%T+00:00")}_}
    				daily
    				0.50
    			
    			
    			
    				{_{site_config.rows.url_prod;lg_en.resub("/","");;if page.rows.page_en ne 'index' then page.rows.page_en; endif}_}
    				{_{datetime(table:"sed_site_lg",lg:"en",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;"fr/news-item/"; news.rows.seo_fr;}_}
        		1969-12-31T19:00:00+00:00
            
            
        		{_{site_config.rows.url_prod;"en/news-item/"; news.rows.seo_en;}_}
        		{_{datetime(table:"sed_site_lg",lg:"en",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 
}_}
            
        		fr/calendar-details/
        		1969-12-31T19:00:00+00:00
            
            
    		en/calendar-details/
    		1969-12-31T19:00:00+00:00
        
{_{  endfor}_}


SEE ALSO

{{ include("includes/extenso_functions.sn") }}

AUTHOR

Written by Pascale Dewingaerde

MODIFICATIONS

1.0 2016-08-05 13:24:14 pascale@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.