Tech Support Posted January 8, 2020 Share Posted January 8, 2020 General sitemap structure in KVS KVS renders sitemap dynamically as a typical web page configured to produce XML format instead of HTML. You can find sitemap page in Website UI -> Pages -> [system] Sitemap: Due to specific sitemap structure limitations on the number of links, KVS breaks down sitemap into several sitemap indexes, rendering different entities: Videos Albums Playlists Tags Models Categories Sponsors Channels Sitemap indexes that can potentially generate more than 50k links are additionally broken down into paginated sitemaps. That's why sitemap page renders 2 blocks for some object types (videos, albums, playlists, models, tags): one block is for listing all pages (e.g. Sitemaps Videos), another block is for listing all objects per page (e.g. Links to Videos). For categories, sponsors and channels KVS considers that their amount is small, so they are rendered as single lists. Adding search queries into sitemap Since the number of search queries is potentially unlimited, you should consider adding them as 2 blocks similar to models. 1) Open Sitemap page for editing and add the following 2 blocks into it: {{insert name="getBlock" block_id="search_results" block_name="Sitemaps Search Queries"}} {{elseif $smarty.request.type=='search'}} {{insert name="getBlock" block_id="search_results" block_name="Links To Search Queries"}} Here are the highlighted locations where to add these blocks as their position is quite important: 2) Save page editor. After saving you can see that 2 new blocks were added to page structure with default settings: 3) Open Sitemaps Search Queries block for editing. Set its template to the following code: {{section start=1 loop=$nav.page_total+1 name=pages}} <sitemap> <loc>{{$lang.urls.sitemap}}?type=search&from_links_search={{$smarty.section.pages.index}}</loc> <lastmod>{{$smarty.now|date_format:"%Y-%m-%d"}}</lastmod> </sitemap> {{/section}} Set Cache lifetime (s) to 86400. Set the following parameter values: items_per_page = 500 var_from = from_sitemaps_search sort_by = Query text Desc Save this block editor. 4) Open Links To Search Queries block for editing. Set its template to the following code: <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> {{foreach item=item from=$data}} {{assign var="query" value=$item.query|replace:"-":"[dash]"|replace:"&":"%26"|replace:"?":"%3F"|replace:"/":"%2F"|replace:" ":"-"|replace:"[dash]":"--"|rawurlencode}} <url> <loc>{{$lang.urls.search_query|replace:"%QUERY%":$query}}</loc> <lastmod>{{$smarty.now|date_format:"%Y-%m-%d"}}</lastmod> <changefreq>weekly</changefreq> <priority>0.6</priority> </url> {{/foreach}} </urlset> Set Cache lifetime (s) to 86400. Set the following parameter values: items_per_page = 500 var_from = from_links_search sort_by = Query text Desc Save this block editor. 5) Now you should have a fully working search sitemap inside your main sitemap index. Try opening your sitemap and look for "search" keyword: http://domain.com/sitemap.php If your database has search queries, you should see something like this in your sitemap: http://domain.com/sitemap/?type=search&from_links_search=1 http://domain.com/sitemap/?type=search&from_links_search=2 .... 5 2 Quote Link to comment Share on other sites More sharing options...
Helmuts DNMUM.com Posted April 27, 2023 Share Posted April 27, 2023 Thank you very much! Awesome! Helmuts Quote Link to comment Share on other sites More sharing options...
Tanjiro Posted August 25, 2023 Share Posted August 25, 2023 I see its block has default code like this Do I need to replace with whole below code to the template or put it inside <div> ? On 1/8/2020 at 1:43 PM, Tech Support said: {{section start=1 loop=$nav.page_total+1 name=pages}} <sitemap> <loc>{{$lang.urls.sitemap}}?type=search&from_links_search={{$smarty.section.pages.index}}</loc> <lastmod>{{$smarty.now|date_format:"%Y-%m-%d"}}</lastmod> </sitemap> {{/section}} Quote Link to comment Share on other sites More sharing options...
Tech Support Posted August 27, 2023 Author Share Posted August 27, 2023 You need to fully replace the code with the provided one. Nothing should be left from default code. 1 Quote Link to comment Share on other sites More sharing options...
ALVINI Posted August 30, 2023 Share Posted August 30, 2023 My sitemap.php has only 1 line... Am I looking in the wrong place? Quote Link to comment Share on other sites More sharing options...
Tech Support Posted August 31, 2023 Author Share Posted August 31, 2023 12 hours ago, ALVINI said: My sitemap.php has only 1 line... Am I looking in the wrong place? Yes, wrong place. This file should not be edited. Quote Link to comment Share on other sites More sharing options...
snqke Posted January 31 Share Posted January 31 i have a lot of these links (as you can see in the screenshot) https://domain.com/search/%EF%BD%91%EF%BD%89%EF%BD%81%EF%BD%8F%EF%BD%8E%EF%BD%89%EF%BD%95%EF%BC%B4%EF%BC%B4/ is this normal ? is this affect my website ? Any one can help ? Quote Link to comment Share on other sites More sharing options...
Tech Support Posted January 31 Author Share Posted January 31 This is normal, URLs are urlencoded, and even when you see in browser's address line some non-latin characters, this is because browser tricks you for human-readable display. The internal URL representation is like you see in KVS sitemap. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.