Adding album title snippit to photo page titles?

ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Wed, 2008-01-23 16:20

I would like to start each photo page title with a snippit of text describing which album (category) it's in, i.e. "landscape photos - view of the lake in autumn". PGlighbox theme allows you to do this but it also adds the snippit to the beginning of each album page title, which I don't want. Is there a way of modifying the theme to have it stop adding the snippit to each album title? Thanks!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25965
Posted: Thu, 2008-01-24 02:30

this is theme.tpl:

			<title>
		  {if !isset($SlideShow)}
		    {if $theme.params.site}
		      {$theme.params.site} - 
		    {/if}
		    {$theme.item.title|markup:strip|default:$theme.item.pathComponent}
		  </title>

you don't want to show the
{$theme.params.site} -
on the photo page?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Thu, 2008-01-24 23:36

I do want the title on photo pages, but not on album pages. I want to be able to add a bit of text to the beginning of each photo page title. PGLightbox allows you to do this in a roundabout way with the "Site ID" feature. However the Site ID is also added to the beginning of the album title, which I don't want. Since it's being added to the theme.tpl is there any way to control this? thanks!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25965
Posted: Thu, 2008-01-24 23:59

I don't use this theme so you will have to tell me what:
{$theme.params.site} -
is?
is that the Site ID you talk about? Remove it from the above code to see.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
net4earning
net4earning's picture

Joined: 2007-06-02
Posts: 202
Posted: Fri, 2008-01-25 12:11

i suggest u to add a custom field via "custom Field" Plugins
then put tht variable in to Title tag.
for coding Floridave might help us how to do tht.
===============================================================================
|| Gallery || Make Money Online ||
======================================================

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Fri, 2008-01-25 17:01

Dave, you are correct removing the following code removes the site ID feature entirely:

{if $theme.params.site}
{$theme.params.site} -
{/if}

By implementing the site ID in the theme.tpl file the Site ID is being added to both the albums and the templates. Is there a way to move it to just the photo.tpl file?

Net4earning -

I have tried to use the custom field plugin to do this several times, but nothing ever seems to happen. Maybe I just don't understand how it works...what variable are you referring to?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25965
Posted: Fri, 2008-01-25 19:28

{if $theme.pageType == 'photo'}......{/if}

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Fri, 2008-01-25 22:37

This is what I replaced the code with in theme.tpl and I get an error:

{if theme.pageType == 'photo'}
{$theme.params.site} -
{/if}

Is this what you meant?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25965
Posted: Fri, 2008-01-25 23:13

Forgot the $

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Sat, 2008-01-26 16:49

Ah now it works, but I still won't be able to use it. The main page of my site depends on the Site ID for it's title since I can't add the title through the admin panel's title box. I currently have the title there set as "Home" and that acts as the home link in my breadcrumb. I use the Site ID to add the title to that one page, so that is the one exception to the rule. Is there a way to do this using custom fields like the previous post mentioned? Thanks for the help!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25965
Posted: Sat, 2008-01-26 17:09

I don't understand. You wanted to remove the {$theme.params.site} - from all pages except for the photo pages.
NOw you you want to remove it from all pages except the root album and the photo pages?

Dave << confused.
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Sat, 2008-01-26 18:30

Yes and it worked...but the main page is part of an album as well, so it removed the title from the main page. If I simply added a title for the main page through the admin panel I would have a very long link in the breadcrumb, instead of the "home" link I have now. Unless there's a way of saying "use this on every photo page and the main page" its not going to work. Do you think there a way of doing this using custom fields instead?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25965
Posted: Sat, 2008-01-26 23:53

I not familiar with this theme at all
if you want a different title for the root album:

{if empty($theme.parents)}
<title>{$theme.params.site}</title>
{else}
		{* If Gallery doesn't provide a header, we use the album/photo title (or filename) *}
		{if empty($head.title)}
			<title>
		  {if !isset($SlideShow)}
		    {if $theme.params.site}
		      {$theme.params.site} - 
		    {/if}
		    {$theme.item.title|markup:strip|default:$theme.item.pathComponent}
		  </title>
		  {/if}
		{/if}
{/if}

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25965
Posted: Sun, 2008-01-27 01:48

@custom fields:
create a custom field in this test case I called the field 'MyCustomField'

{g->callback type="customfield.LoadCustomFields" itemId=$item.id|default:$theme.item.id}
{$block.customfield.LoadCustomFields.fields.MyCustomField}

it will show the value of the field.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Tue, 2008-02-05 22:14

Thanks Dave but i can't figure out how to create a custom field. I have the module installed and I create the field, but it doesn't do anything. For instance, I created a field called "Photo" for only photo pages. I added the word "Photo:" to the picklist. I expect to see a field named "Photo" when i go to each photo's admin page, but its not there. I'm not doing something right, but there's no info I can find on the gallery site which explains how to set up proper custom fields.

Thanks!