Some problems trying to do a sitemap for the Gallery module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
archeo
Forum Members
Forum Members
Posts: 107
Joined: Tue Oct 21, 2014 12:47 pm

Some problems trying to do a sitemap for the Gallery module

Post 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?
psy
Power Poster
Power Poster
Posts: 463
Joined: Sat Jan 22, 2005 11:19 am

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

Post 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}
archeo
Forum Members
Forum Members
Posts: 107
Joined: Tue Oct 21, 2014 12:47 pm

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

Post 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"
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

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

Post 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....
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
archeo
Forum Members
Forum Members
Posts: 107
Joined: Tue Oct 21, 2014 12:47 pm

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

Post 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 ?
Post Reply

Return to “Modules/Add-Ons”