ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Sitemap URL in xml file, template group name/comments

September 09, 2010 12:16pm

Subscribe [2]
  • #1 / Sep 09, 2010 12:16pm

    Brad Morse

    428 posts

    Here is a snippet of the rendered xml

    <url> 
      <loc>http://www.domain.com/weblog/comments/yoga_workout_-_section_a/</loc> 
      <lastmod>2010-08-04T12:17:42+00:00</lastmod> 
      <changefreq>weekly</changefreq> 
      0.5</priority> 
    </url>

    Here is the code I have in the sitemap xml template:

    {assign_variable:master_weblog_name="default_site"}
    {assign_variable:template_group_name="weblog"}
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset >
    <url>
      <loc>{homepage}</loc>
      <lastmod>{exp:stats}{last_entry_date format="{DATE_W3C}"}{/exp:stats}</lastmod>
      <changefreq>always</changefreq>
      1.0</priority>
    </url>
    {exp:weblog:entries limit="500" disable="categories|custom_fields|member_data|pagination|trackbacks" rdf="off" dynamic="off" status="Open"}
    <url>
      <loc>{title_permalink="{template_group_name}/comments"}</loc>
      <lastmod>{gmt_edit_date format="{DATE_W3C}"}</lastmod>
      <changefreq>weekly</changefreq>
      0.5</priority>
    </url>
    {/exp:weblog:entries}
    </urlset>

    I would like it to auto link to the auto path, which you set in each weblog’s preferences section, which comes in handy when returning search results. Is this possible? url_title_path/comments seems generic.

  • #2 / Sep 09, 2010 7:14pm

    Brandon Jones

    5500 posts

    Hi Brad,

    I’ll need to shift this over to the CodeShare Corner to get you more input, as everything is working as expected here. Thanks.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases