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.

exp:stats in sitemap.xml not working

August 20, 2011 3:53pm

Subscribe [3]
  • #1 / Aug 20, 2011 3:53pm

    123454329

    144 posts

    This question may be related to a resolved thread.

    This issue persists in v2.2.1 - Build: date 20110705. Turning off “Online User Tracking” shuts down <lastmod>{exp:stats}{last_entry_date format="{DATE_W3C}”}{/exp:stats}</lastmod> in /sitemap.xml

    Please replicate. Thanks!

    Also,

    Yep, I can replicate this and we’ll get a fix into the next release. For now you can change line 147 (not 177) of system/expressionengine/modules/stats/mod.stats.php to
    
    if ($this->EE->stats->statdata('current_names') AND count($this->EE->stats->statdata('current_names') > 0))

    does not resolve the isssue for me.

  • #2 / Aug 22, 2011 4:45am

    John Henry Donovan

    12339 posts

    Thimas,

    I tested in EE2.2.2 and do not get an error. I do not get a result either only a double hyphen from the date formatting. Before progressing with this I need to know what is happening in your case.

  • #3 / Aug 22, 2011 6:11am

    123454329

    144 posts

    John,
    same thing here. {exp:stats} does not display {last_entry_date format=”{DATE_W3C}”} in my sitemap.xml while it should. shouldn’t it?

  • #4 / Aug 23, 2011 3:53am

    John Henry Donovan

    12339 posts

    Thomas,

    Try adding the channel parameter. That worked for me.

    <lastmod>
    {exp:stats channel="news"}
    {last_entry_date format="{DATE_W3C}"}
    {/exp:stats}
    </lastmod>
  • #5 / Aug 23, 2011 9:31am

    123454329

    144 posts

    john,
    that was helpful. adding an existing channel parameter displays an {last_entry_date format=”{DATE_W3C}”} - although i have no idea where that date is taken from as it is not a recent one.

    thank you.

  • #6 / Aug 24, 2011 4:51am

    John Henry Donovan

    12339 posts

    Thomas,

    In a separate blank template can you add the following please

    {exp:channel:entries channel="news" dynamic="no" limit="1" orderby="date"}
    <h1>{title}</h1>
    <h2>{entry_date format="{DATE_W3C}"}</h2>
    <p>{/exp:channel:entries}

    Does that reflect the most recent date for that entry?

  • #7 / Aug 24, 2011 11:29am

    123454329

    144 posts

    Here’s the code is use for now:

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset
    >
    {exp:channel:entries channel="pages" disable="categories|custom_fields|member_data|pagination|trackbacks" rdf="off" dynamic="no" limit="1" orderby="date"}
    <url>
    <loc>http://domain</loc>
    1.0</priority>
    <lastmod>{gmt_edit_date format="{DATE_W3C}"}</lastmod>
    <changefreq>always</changefreq>
    </url>
    {/exp:channel:entries}
    
    {exp:channel:entries channel="pages" disable="categories|custom_fields|member_data|pagination|trackbacks" rdf="off" dynamic="no" limit="1" orderby="date"}
    <url>
    <loc>http://domain.com/cart</loc>
    0.9</priority>
    <lastmod>{gmt_edit_date format="{DATE_W3C}"}</lastmod>
    <changefreq>always</changefreq>
    </url>
    {/exp:channel:entries}
    
    {exp:channel:entries channel="pages" orderby="title" sort="asc" disable="categories|custom_fields|member_data|pagination|trackbacks" rdf="off" dynamic="no"}
    <url>
    <loc>http://domain.com{page_uri}</loc>
    0.8</priority>
    <lastmod>{gmt_edit_date format="{DATE_W3C}"}</lastmod>
    <changefreq>daily</changefreq>
    </url>
    {/exp:channel:entries}
    
    {exp:channel:entries channel="pages-store" orderby="title" sort="asc" disable="categories|custom_fields|member_data|pagination|trackbacks" rdf="off" dynamic="no"}
    <url>
    <loc>http://domain.com{page_uri}</loc>
    0.7</priority>
    <lastmod>{gmt_edit_date format="{DATE_W3C}"}</lastmod>
    <changefreq>daily</changefreq>
    </url>
    {/exp:channel:entries}
    
    {exp:channel:entries channel="products" orderby="title" sort="asc" disable="categories|custom_fields|member_data|pagination|trackbacks" rdf="off" dynamic="no"}
    <url>
    <loc>{path=cart/product_detail/{entry_id}}</loc>
    0.6</priority>
    <lastmod>{gmt_edit_date format="{DATE_W3C}"}</lastmod>
    <changefreq>daily</changefreq>
    </url>
    {/exp:channel:entries}
    </urlset>

    any suggestion for me, John?

  • #8 / Aug 25, 2011 11:42am

    Kevin Smith

    4784 posts

    Hi Thomas,

    I don’t believe I’m able to reproduce the issue you’re having. Are you running the latest version of EE?

    Using your code above, I’m getting an XML file output that includes…

    <lastmod>2011-08-25T08:31:26+00:00</lastmod>

    Is that what you’re getting? If not, post back here with the output you get.

  • #9 / Aug 30, 2011 2:25am

    123454329

    144 posts

    v2.2.1 - Build: date  20110705

  • #10 / Aug 30, 2011 11:29am

    Kevin Smith

    4784 posts

    Since I’m not experiencing the issue you’re describing and we’re running different versions of EE, let me get you to upgrade your installation to the latest version, which at the time of writing is 2.2.2.

    Once you’ve done that, post back with an update on your progress. Thanks!

  • #11 / Aug 30, 2011 1:51pm

    123454329

    144 posts

    Kevin,
    thanks for your encouragement! I updated and things are good.

    Regarding my example code this update does not change the outcome. as john suggested adding the channel parameter displays the edit date.

    <lastmod>{exp:stats}{last_entry_date format=”{DATE_W3C}”}{/exp:stats}</lastmod>

    displays two dashes (for me).

  • #12 / Aug 31, 2011 1:43pm

    Kevin Smith

    4784 posts

    That’s so odd. That’s not happening to me. Are you sure your Channel Entries tag is outputting anything? Throw in some other Channel Entries single variables as well as date variables. Is it outputting anything at all? If so, where does it fall short?

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

ExpressionEngine News!

#eecms, #events, #releases