I use the {gallery} tag on a single page called pictures. From here the users can browse though all the sub galleries defined by the folder structure.
Each of the sub galleries have their own title, but the title of the html document is always just <title>domain - pictures<title>
Can the gallery module set the title of the page?
I would like something like this <title>domain - pictures - sub gallery name </title>
[Solved] {gallery} Add (sub) gallery name to html title tag
[Solved] {gallery} Add (sub) gallery name to html title tag
Last edited by thile on Fri Apr 22, 2011 6:11 pm, edited 1 time in total.
Re: {gallery} Add (sub) gallery name to html title tag
Sure, just change the code in your pagetemplate to something like this
Code: Select all
<title>{sitename} - {title}{if isset($gallerytitle)} - {$gallerytitle}{/if}</title>
Re: {gallery} Add (sub) gallery name to html title tag
Can't get it to work.
I'm no expert in what order the content is loaded, but to me it looks like this.
I'm no expert in what order the content is loaded, but to me it looks like this.
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>{sitename} - {title}{if isset($gallerytitle)} - {$gallerytitle}{/if}</title> <!--- $gallerytitle is not set yet --->
{metadata}
</head>
</__body>
<div id="content">
<h2>{title}</h2>
{content} <!--- This content tag will eventually load the content of "pictures" page that contains the gallery tag. And only from here and forward we know the $gallerytitle variable --->
</div><!-- /content -->
...
</div><!-- /footer -->
</div><!-- /wrap -->
<__script__ type="text/javascript">
...
</__script> <!-- /Google Analytics-->
<__body>
</__html>
Re: {gallery} Add (sub) gallery name to html title tag
which cmsms version do you use?
You might want to study this topic
http://forum.cmsmadesimple.org/viewtopi ... news+title
But note that the order in which the page is parsed has changed a little while back. (somewhere around 1.8 iirc)
You might want to study this topic
http://forum.cmsmadesimple.org/viewtopi ... news+title
But note that the order in which the page is parsed has changed a little while back. (somewhere around 1.8 iirc)
Re: {gallery} Add (sub) gallery name to html title tag
Thanks for the link, will read it thoroughly and return back.Jos wrote:which cmsms version do you use?
You might want to study this topic
http://forum.cmsmadesimple.org/viewtopi ... news+title
But note that the order in which the page is parsed has changed a little while back. (somewhere around 1.8 iirc)
By the way running 1.9.4.1 "Faanui".
Re: {gallery} Add (sub) gallery name to html title tag
Well, I did some testing and encountered a page where it didn't work also.
Could be caused by a reset of the $gallerytitle variable by another {Gallery} call on the same page.
This is how you should get it to work:
Open your gallerytemplate and search for {if !empty($gallerytitle)}<h3>{$gallerytitle}</h3>{/if}
Replace it with:
Then in your page template you can use (note the underscore!)
Could be caused by a reset of the $gallerytitle variable by another {Gallery} call on the same page.
This is how you should get it to work:
Open your gallerytemplate and search for {if !empty($gallerytitle)}<h3>{$gallerytitle}</h3>{/if}
Replace it with:
Code: Select all
{if !empty($gallerytitle)}<h3>{$gallerytitle}</h3>{assign var='gallery_title' value=$gallerytitle}{/if}
Code: Select all
<title>{sitename} - {title}{if isset($gallery_title)} - {$gallery_title}{/if}</title>
Re: {gallery} Add (sub) gallery name to html title tag
My problem is solved with the step-by-step guide in the link. Thanks.thile wrote:Thanks for the link, will read it thoroughly and return back.Jos wrote:which cmsms version do you use?
You might want to study this topic
http://forum.cmsmadesimple.org/viewtopi ... news+title
But note that the order in which the page is parsed has changed a little while back. (somewhere around 1.8 iirc)
By the way running 1.9.4.1 "Faanui".