Page 1 of 1

Some problems trying to do a sitemap for the Gallery module

Posted: Mon Dec 01, 2014 11:26 am
by archeo
Hello,
I am trying to do a sitemap for the Gallery module using Sitemap madesimple and this code

Code: Select all

{capture }
{cms_module module='Gallery'  template="prettyPhoto2" }
{/capture}
{foreach from=$images item=image}
    <url>
        <loc>{$image->file}</loc>
        <lastmod>{$image->filedate|date_format:"%Y-%m-%d"}</lastmod>
        <priority>{$page->priority}</priority>  
        <changefreq>{$page->frequency}</changefreq>
    </url>    
{/foreach}
I want to use {$image->file} for the directories for example :
"http://localhost/cms made simple/galerie/Precambrien/1-16-353.html"
but in the sitemap {$image->file} give me "uploads/images/Gallery/Precambrien/"
My Question is why this difference and is it possible to do a site map for the Gallery module?

Re: Some problems trying to do a sitemap for the Gallery mod

Posted: Mon Dec 01, 2014 8:48 pm
by psy
1. There should be no reason to use {capture}. There have been many posts about how resource-heavy {capture} is. You could just put:

Code: Select all

{Gallery  template="prettyPhoto2" assign=tmp}
{foreach from=$tmp->images item=image}
2. To get the full url put: {root_url}/{$image->file}

Re: Some problems trying to do a sitemap for the Gallery mod

Posted: Mon Dec 01, 2014 10:44 pm
by archeo
Thank you psy, but this does not solve the problem {$image->file} give me "uploads/images/Gallery/Precambrien/" and with {root_url}/ give "http://localhost/cms made simple/uploads/images/Gallery/Precambrien/" instead of "http://localhost/cms made simple/galerie/Precambrien/1-16-353.html"

Re: Some problems trying to do a sitemap for the Gallery mod

Posted: Tue Dec 02, 2014 3:08 pm
by JohnnyB
You might need to look at the template vars again because I don't think {$image->file} is going to give you the location of the pages that show your galleries. That is a link to an image file, not a content page containing a gallery.

Gallery images are stored /uploads/images/Gallery/

So, that tag is actin correctly with or without the {root_url} to provide the full URL path....

Re: Some problems trying to do a sitemap for the Gallery mod

Posted: Tue Dec 02, 2014 4:14 pm
by archeo
For exemple in this part of the template prettyPhoto

Code: Select all

{foreach from=$images item=image}
    <div class="img">
	{if $image->isdir}
    
		<a href="{$image->file}" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a><br />
		{$image->titlename}<br />
        <div class="dircomment">{$image->comment}</div>
        
	{else}
{$image->file} is use in href as link to a gallery page and not as a link to an image when isdir=true
When using assign, the data come from the data base or from the Gallery module ?