Matrix: Where / how to transform (album)title

bognerart
bognerart's picture

Joined: 2007-05-05
Posts: 76
Posted: Tue, 2011-06-21 21:50

Matrix-theme in G2:

I would like to transform the title of the album and the item-title to capital letters and replace "_" with blanks. Which file and which part(s) have to be modified?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2011-06-21 22:23

gallery2/matrix/templates/local/theme.tpl <- copy the original here
somewhere in the <head />

<style>
    .giTitle {
        text-transform: uppercase;
    }
</style>

and somewhere before the </body>
you could add some simple javascript to do the replacement

gallery embed samples

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
bognerart
bognerart's picture

Joined: 2007-05-05
Posts: 76
Posted: Wed, 2011-06-22 13:27

Unfortunately this doesn't work:

I tried with no-script.galerie.priv.at as a test-gallery:

{*
* $Revision: 15342 $
* If you want to customize this file, do not edit it directly since future upgrades
* may overwrite it. Instead, copy it into a new directory called "local" and edit that
* version. Gallery will look for that file first and use it if it exists.
*}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="{g->language}">
<head>

<style>
.giTitle {
text-transform: uppercase;
}
</style>

{* Let Gallery print out anything it wants to put into the <head> element *}
{g->head}

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

It doesn't help too to put it in the body-part, but when step after another. Thanks for helping!

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Wed, 2011-06-22 15:07

A long shot, but try:

<style>
    .giTitle {
        text-transform: uppercase !important;
    }
</style>

More important is to make sure that you clear both the G2 and browser caches.

Go to yoursite , com/gallery folder/lib/support to clear the G2 cache
Your browser should provide help on how to clear its cache (alternatively, try viewing the site with another browser after you clear the G2 cache)

--
dakanji.com

 
bognerart
bognerart's picture

Joined: 2007-05-05
Posts: 76
Posted: Wed, 2011-06-22 16:14

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="{g->language}">
<head>

<style>
.giTitle {
text-transform: uppercase !important;
}
</style>

Now I get "HTTP-Fehler 500 (Internal Server Error)". When I remove the code, the error disappears. Maybe it is a question where I place the code?

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Wed, 2011-06-22 16:30

Have you cleared the caches?

--
dakanji.com

 
bognerart
bognerart's picture

Joined: 2007-05-05
Posts: 76
Posted: Wed, 2011-06-22 20:14

I cleared the cache with
Site Admin / Maintenance Mode / Delete template cache
Site Admin / Maintenance Mode / Delete database cache

I got the error 500 already in mainenance mode. The site was not available anymore, similar to a DNS error.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Wed, 2011-06-22 22:21

The "!important" was a long shot and the main thing to focus on is clearing BOTH your browser and G2 caches

Repeat:

Quote:
More important is to make sure that you clear both the G2 and browser caches.

Go to yoursite , com/gallery folder/lib/support to clear the G2 cache
Your browser should provide help on how to clear its cache (alternatively, try viewing the site with another browser after you clear the G2 cache)

--
dakanji.com

 
bognerart
bognerart's picture

Joined: 2007-05-05
Posts: 76
Posted: Wed, 2011-06-22 23:52

Hmmh, no idea what I have could done wrong.

Do you mean I have to execute no-script.galerie.priv.at/lib/support/cache.php? I did it.

I setup a new user, so I can be sure, that there is nothing in the browsercache.

Maybe it is not clear, what I mean with "uppercase". Have a look at the same gallery, but G3, at galerie.priv.at, where the album names are in capital letters. I want a similar result with the g2-matrix-theme. Thanks"

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Thu, 2011-06-23 09:25

You've done nothing wrong and correctly ran the cache.php.

It appears text-transform is not well/consistently supported by browsers and that only Mozilla based browsers can be relied on to correctly/consistently display it.

Sorry. It seems the only way you can be sure the titles will be capitalised is to type them in as capitals to start with.

--
dakanji.com

 
bognerart
bognerart's picture

Joined: 2007-05-05
Posts: 76
Posted: Thu, 2011-06-23 09:51

Transform works fine with Gallery 3 on the same system with the same browsers.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2011-06-23 11:37

transform works in all major browsers.
And before I suggested it, I tried it on my examples index - which works in all browsers.

Any styles you add to your page need to be after gallery's own css OR make your change to your theme's style sheet directly.
This is not rocket science.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
bognerart
bognerart's picture

Joined: 2007-05-05
Posts: 76
Posted: Thu, 2011-06-23 12:20

I can confirm, that I didn#t find any browser with Linux und WindowsXP which had problems with transform and G3.

Quote:
Any styles you add to your page need to be after gallery's own css

That's what I made wrong for sure. If you look above I added it at the beginning, right after <head>. I will now put it bevore </head> and try again.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Thu, 2011-06-23 14:00

Ha! My impression on this is dated then.

However, as far as I know, while it is supported in all major browsers, only the Mozilla browsers fully support it without bugs but then, I may be well and truly wrong.

bognerart wrote:
That's what I made wrong for sure.

Most likely.

--
dakanji.com

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Mon, 2011-12-12 19:55
bognerart wrote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="{g->language}">
<head>

<style>
.giTitle {
text-transform: uppercase !important;
}
</style>

Now I get "HTTP-Fehler 500 (Internal Server Error)". When I remove the code, the error disappears. Maybe it is a question where I place the code?

try like this

<style type="text/css">
{literal}
    .giTitle {
        text-transform: uppercase !important;
    }
{/literal}
</style>

http://codex.gallery2.org/Gallery2:How_to_visually_embed_Gallery_in_your_own_website_by_editing_theme_templates
If you need to insert JavaScript code, you will have to add {literal}your JavaScript code{/literal} tags around it. The reason is that in Gallery templates, we use the Smarty language and the curly braces { and } are reserved characters. And these characters are quite frequent in JavaScript code. Instead of using {literal}{/literal}, you can also use {ldelim} for the left { and {rdelim} for the right curly brace. See The Official Smarty FAQ

or better enter CSS code directly in your theme.css

 
bognerart
bognerart's picture

Joined: 2007-05-05
Posts: 76
Posted: Mon, 2011-12-12 20:08

Thanks, but I stopped offering G2 and G3 with my album, and I use G3 only now.
__

Gallery 3.0.2 Coollanta - PHP 5.3.2 - Apache2 2.2.14 - Mysql 5.1.41 - Linux kernel 2.6.32
Gallery: bognerart.eu