Line breaks in Titles? (also quick url format question)

WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Mon, 2012-04-09 13:24

I'm using Gallery 2.3.1 core 1.3.0.1.
If I add a photo using Gallery Remote, I can add carriage returns in the tile and then in the gallery, the title is broken into separate lines. This is especially good for my art site gallery, where I can have titles like this:

Quote:
Title of Piece
oil on canvas, 28" x 24"
$450

If that was all on one line it would look cluttered.

The problem is that if I edit the photo text once it's in the gallery, the title field is just a text box, not a text area, and it doesn't allow things like <br /> tags in the title, so I lose my multi-line title if I edit anything about the photo. I've even tried to do it straight in the database through phpMyAdmin, but it gives single lines there if the line is already a single line--though if it's already multi-line I can edit it that way. Is there a way to re-multi-line a title after you've messed it up and altered it to a single line?

I was thinking that for the edit photo form, having a text area instead of a text box for the title input would be the fix, but I don't know enough programming to know which file to edit and what line to edit, etc... maybe someone can either tell me how to do that or tell me another way to solve my problem?

Here is my art gallery by way of example. This is the paintings album where you can see that most of the paintings have multi-line titles: http://katherinehowardartist.com/gallery/main.php?g2_itemId=199

(Oh, and speaking of that link--my other gallery shows a different type of url--where is that setting? The other gallery formats urls like this: http://gallery2.opalcat.com/gallery2/v/Art/ which I would prefer to the g2_item=## blah blah thing.)
--
WebKat, Gallery2 holdover extraordinaire.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-04-09 15:04

You should be able to do that automatically to some degree in your template
something like:
{$child.title|markup|replace:_:'<br>'}
that would replace any underscore with a break

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

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-04-09 15:07
Quote:
(Oh, and speaking of that link--my other gallery shows a different type of url--where is that setting? The other gallery formats urls like this: http://gallery2.opalcat.com/gallery2/v/Art/ which I would prefer to the g2_item=## blah blah thing.)

Url rewrite module does that

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

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Mon, 2012-04-09 15:55

Right but how do I set it to do that. I looked at the options and it didn't leap out at me.

--
WebKat, Gallery2 holdover extraordinaire.

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Tue, 2012-04-10 03:08

Ok I figured out how to be able to edit titles with multiple lines:
The file I edited is gallery/modules/cores/templates/ItemEditItem.tpl
Lines 60 and 61:

<input type="text" id="title" size="60" maxlength="{$ItemEdit.fieldLengths.title}"
name="{g->formVar var="form[title]"}" value="{$form.title}"/>

changed it to:

<textarea name="{g->formVar var="form[title]"}" id="title" 
cols="60" rows="4" maxlength="{$ItemEdit.fieldLengths.title}">
{$form.title}
</textarea>

This way when you edit an item, the title box is a text area not a text box, so you can have multiple lines and line breaks.

I still need to know how to configure url rewrite to get those urls that I like...
--
WebKat, Gallery2 holdover extraordinaire.