Centering Frame graphics / elements.

Knight Scene
Knight Scene's picture

Joined: 2006-03-06
Posts: 37
Posted: Sat, 2006-12-23 02:08

I'm trying to find a way of making the lower image of a photo frame center itself.

That is, instead of the BL BM and BR pieces as are, I require the Bottom Middle section to stay "centered" instead of drawing tiled from the left.

With this done I would then place the pieces as follows
BL, BBL, BM, BBR, BR.

Bottom Bottom left and right would simply fill in the spaces adjacent to the central image
OR
The central image would be created 1000 - + wide as a cheapskate fix but I dont want to do this because it closes the avenue for the left and right tiling images of the central ones inner from the corners to be edited.

The reason Im doing this is because each Album could have a graphical logo title (regardless of the text version) staying pictorially centered like in real exhibitions. A gold plate with the etched title on etc or similar.

But this isnt going to work correctly with the current scripts and for the life of me I cant find the damned solution and I know its staring me in the face I just cant crack it.

Rather than deliver the solution... what file would I need to look at for editing?

"Im not admitting defeat. I'm just un-successfully challenged!"

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-12-26 07:01

What I would do is create a custom module. Copy the exsisting image frame module and rename it.
http://codex.gallery2.org/index.php/Gallery2:Module_Development_Tutorial
After you get the copy module to work right.....

Then in gallery2/modules/imageframe/templates/containers/ImageFrame.tpl make your changes as well as:
gallery2/modules/imageframe/templates/ImageFrameStyle.tpl

Good luck. I would like to see this.

Dave

____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery

 
Knight Scene
Knight Scene's picture

Joined: 2006-03-06
Posts: 37
Posted: Wed, 2006-12-27 03:27

Hey, Dave. Thanks. I'm working on this again as it also opens up alot of design avenues for further frames.
Ill go through this in the morning and see where I can fix it up.
Thanks again for the pointers.
KnightScene

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2006-12-27 03:57

Come to think of this.....I think what you want to do can be done with CSS.
Your image frame with the plate on the bottom could have positioned text (album title or image title) over that plate graphic.

let me play with that while you play with the custom module.

Dave

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2006-12-27 22:16

OK after some sleep I think I got what you want to archive with some css and DHTML:
http://langleycom.com/gallery2/v/Vegas80s-Sumulsat.jpg.html

Only 2 files to edit:
1. give the table cell a ID.
in:
/gallery2/modules/imageframe/templates/container/ImageFrame.tpl
find the bottom row of the frame:
<td class="BB"{if $data.wHL or $data.wHR} and add an id: <td id="BB" class="BB"{if $data.wHL or $data.wHR}

2. Now we have an Id for that cell and we can change on the fly in the photo.tpl
Add this to the bottom:

<script type="text/javascript">
document.getElementById('BB').innerHTML="<center><table border='0' cellspacing='0' cellpadding='10'><tr><td class='BPL'></td><td class='BPC'><P STYLE='font-size: 12px;'> {$theme.item.title|markup} </p></td><td class='BPR'></td></tr></table></center>";
document.getElementById('BB').style.height="51px";
</script>
{literal}
<style>
table.ImageFrame_PhotoCornersSilverPlate .BPR { width:51px; height:51px; background:url(http://langleycom.com/gallery2/modules/imageframe/frames/PhotoCornersSilverPlate/BBPR.gif) no-repeat; }
table.ImageFrame_PhotoCornersSilverPlate .BPL { width:51px; height:51px; background:url(http://langleycom.com/gallery2/modules/imageframe/frames/PhotoCornersSilverPlate/BBPL.gif) no-repeat; background-position: right bottom; }
table.ImageFrame_PhotoCornersSilverPlate .BPC { height:51px; background:url(http://langleycom.com/gallery2/modules/imageframe/frames/PhotoCornersSilverPlate/BBPC.gif) repeat-x; }
</style>
{/literal}

That overwrites the cell with a table with the title of the item in the center cell.
Some CSS to give the plate look behind the text.

You could add the CSS to the theme CSS and add the 3 images to the the theme or the frame.

I will let you finish it off.

Dave

 
gaynormcc
gaynormcc's picture

Joined: 2003-09-05
Posts: 426
Posted: Fri, 2006-12-29 04:15

Hi Dave,
I have read through your code above and seen your sample.
I am wondering though, how would we change the vertical position of the superimposed text within the frame, if we move the brass plate up to a more natural position in the upper part of the bottom piece of the frame. (The part that would in a physical frame, be flat or gently rounded) ?
I am thinking in terms of html code <align="center", valign="top"> with maybe the text having a <br>&nbsp; in it to allow for the inner shaping of the "physical" frame.
Though I guess this is too simplistic.

Also could this be adapted to set the plaque centrally in the section of the original frame comprising BBL, BB, BBR without the corner pieces, for when the left side of the frame is unequal to the right, (for eg) representing the spine of a book?
We would then be looking at the table having 5 columns - the three you use here and two variables (equal to each other) BBL and BBR on either side of that group. eg the Author's name appearing centrally on the book's front cover.

Gaynor

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2006-12-29 04:41

The easy way would be to change the "plate" and move it up a bit.
the 3 files are:
http://langleycom.com/gallery2/modules/imageframe/frames/PhotoCornersSilverPlate/BBPL.gif
http://langleycom.com/gallery2/modules/imageframe/frames/PhotoCornersSilverPlate/BBPC.gif
http://langleycom.com/gallery2/modules/imageframe/frames/PhotoCornersSilverPlate/BBPR.gif
See how the plate is too low on the frame?
A graphics editor is needed to correct the positioning of the "plate".

All that is needed is to adapt the 3 above files to the frame type you want to use.

I just used the graphics that Knight Scene had in his custom frame.
New "plates" would be needed for all the different frames.
I will leave it up to others (that are more artsy) to make it better.

Dave

____________________________________________________
Blog with G2 || G2 theme contest: $3K in Prizes

 
gaynormcc
gaynormcc's picture

Joined: 2003-09-05
Posts: 426
Posted: Fri, 2006-12-29 11:35

Yes, I have no problem with the artsy part, but my concern is the text placement if it is not part of the graphic, (preferable) and with a choice of Album name or Item title.

And also the issue of unequal left and right sides to the frame - wanting the central graphic centred in the part between those unequal sides.

Like Knight Scene, I can see interesting developments once we get these problems sorted out.

Gaynor.

Gaynor

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2006-12-29 18:31

Im a bit lost.
1.the 2 issues are horizontal placement?
It is centered. The center cell where the title of the image is bigger for longer titles and shorter for shorter titles.

2. & vertical placement?
That is done with the plate graphics. I guess in the css we could move the text down a bit if that the desire.

3. You want the title to be different than the item? I don't think a album title would be desirable on a photo.
The text can be changed to the title of the album if that is the desire.
{$theme.item.title|markup} can be changed if you need.

____________________________________________________
Blog with G2 || G2 theme contest: $3K in Prizes

 
gaynormcc
gaynormcc's picture

Joined: 2003-09-05
Posts: 426
Posted: Sat, 2006-12-30 02:21

Hi Dave.

Apologies for losing you.
I have a client who is an artist. I would like to be able, in her folder of my gallery, to be able to have her name and locality on the plaque.
As there are other artists round me, I'd also like to be able to do this in the master frame rather than making a new one for each..... and felt that other uses could come from this, eg tourist photos of localities.

Maybe I am thinking in overkill.

Gaynor

 
Knight Scene
Knight Scene's picture

Joined: 2006-03-06
Posts: 37
Posted: Sun, 2006-12-31 11:33

So Ill look at this now and post my results......

Neil.
KnightScene

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2006-12-30 03:42

Knight Scene I did not understand much of that but what I did get was

Quote:
Ill post my results

.
gaynormcc, How about a custom field that the plate will get populated with? Defaulting to the items title?

Dave
____________________________________________________
Blog with G2 || G2 theme contest: $3K in Prizes

 
gaynormcc
gaynormcc's picture

Joined: 2003-09-05
Posts: 426
Posted: Tue, 2007-01-02 07:56

Thanks Dave,
I have been scurrying round in forums trying to learn about Custom Fields, not finding the basics.
Can you point me to a good tutorial?

In the Customizing G2 I see "Adding a module requires PHP coding ability" which I do not have.
Is it needed for Custom Fields?

If so, as Neil and I are hearing in the same general direction, maybe if I talk sweetly to him he might do it for me.

But I would like to learn to do these things for myself so I can head off in crazy directions at will, without bothering others. (I'd far rather be a help than a hindrance)

Gaynor