Picture and custom fields centered

FlyFort

Joined: 2004-11-07
Posts: 145
Posted: Thu, 2005-09-15 18:34

Hello everyone,

Can anyone tell me how I can center my pictures and custom fields, like it was done in G1???

Thanks in advance

ps. Great job everyone. Seems you did it all this time

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Thu, 2005-09-15 21:05

edit the right parts in the css file of the theme your are using. To center everything in the image blocks (like random image block) you need to add code to the end of the css file like this:

.block-imageblock-ImageBlock {
    text-align: center;
}

Or perhaps

.block-imageblock-ImageBlock * {
    text-align: center;
}

But please note it is better to find the correct section inside the css if already available and to exclude unpleasant surprises be as specific as possible like "#gsSidebar .block-imageblock-ImageBlock"

 
FlyFort

Joined: 2004-11-07
Posts: 145
Posted: Fri, 2005-09-16 16:01

Not very happy with this solution, it works only for the pics in the sidebar.

But I want again something like the layout of the custom fields of G1

http://www.militaryaircraftcollection.info/Dbase/gallery/view_photo.php?set_albumName=album37&id=DASSAULT_MIRAGE_V_BA_BA_24_01
Both picture and the text are centered.

And can anyone tell me how I can put the text just like it is on the picture???
eg:

A :text
BCD :text etc

Thanks in advance

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Fri, 2005-09-16 17:19

Well, my solution was a start for some items, of course you need to identify everything you want centered and change the stylesheet accordingly. If nobody programmed such an option into the theme (and nobody did) then it is manualy work that is going to do the trick ;)

 
FlyFort

Joined: 2004-11-07
Posts: 145
Posted: Fri, 2005-09-16 17:40

Not good :-(

Someone who can help me out with this problem then???

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Fri, 2005-09-16 17:51

[funnymode]Add the following code to the start of the css:

* {
     text-align: center;
}

This will align all images and the text belonging to the items to the center of their containers.[/funnymode]

The downside is you might want to have some stuff aligned to the right or left. If that isn't specified already then it will also align in the center...

But seriously, there is no other way then going through the stylesheet and add text-align: center; for everything you want to align in the center unless someone already did that work for you and wants to share the theme/style

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Fri, 2005-09-16 17:52

*doublepost*, sorry

(this new server is testing my nerves, I keep on getting 404's or something)

 
FlyFort

Joined: 2004-11-07
Posts: 145
Posted: Fri, 2005-09-16 18:01

Picture is already on his place a you can see here
http://www.militaryaircraftcollection.info/Dbase2/gallery2/v/Uploadalbum_0/IMG_2573.jpg.html

But still have to find a way to get the customfields placed like at G1
At G1 I think they work with tables. Why didn't do that in G2???

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Fri, 2005-09-16 23:38

Sorry, I didn't get it at first.

You have to go into the directory "gallery2\modules\customfield\templates\blocks\local\" (create directory if it doesn't exist). Then create a file called "CustomFields.tpl" in this directory and give it the following content:

{*
 * $Revision: 1.2 $
 * 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.
 *}
{g->callback type="customfield.LoadCustomFields" itemId=$item.id|default:$theme.item.id}

{if !empty($block.customfield.LoadCustomFields.fields)}
<div class="{$class}">
  <h3> {g->text text="Custom Fields"} </h3>
  <table>
    {foreach from=$block.customfield.LoadCustomFields.fields key=field item=value}
    <tr>
      <td class="giDescription giDescriptionLabel">
        {$field}
      </td>
      <td class="giDescription">:</td>
      <td class="giDescription">
         {$value|markup}
      </td>
    </tr>
    {/foreach}
  </table>
</div>
{/if}

That will do the trick and give the exact result!

(Use css to style giDescriptionLabel as bold text...)

Custom fields *could* be seen as tablular data so perhaps the custom fields module should indeed use tables, but the creator thought otherwise ;) Luckily changing is easy enough :P

 
autobulb

Joined: 2003-08-16
Posts: 44
Posted: Sat, 2005-09-17 07:50

Great fix. Thanks.

 
FlyFort

Joined: 2004-11-07
Posts: 145
Posted: Sat, 2005-09-17 09:05

RWD

Thanks a lot m8
You did a great job.

I hope more people can use this feature and hopefully the development team will think about it to use this as standard.

Again, thanks a lot

 
AVSF

Joined: 2005-11-22
Posts: 40
Posted: Tue, 2005-12-20 11:35

Hi,
In the end, how did you manage to center both picture and custom fields ? I make the changes RwD posted above, and get the fields in a tab, but nothing is centered yet...
thank you for your help, you did a great job anyway!

 
cervantes_roger

Joined: 2006-10-25
Posts: 17
Posted: Wed, 2006-10-25 16:30

Any way to struct custom fields in separate zones? I mean, i have more than 10 fuelds, some refer to the image, others to the photographer and some other ones to the rights and things like that. I want them to appear more or less like this:

------------------------------------------
FIRST ONES
customfield1:value
customefield2:value
customfield3:value

SECOND ONES
customfield4:...
customfield5:...

LAST ONES
customfield6:...
------------------------------------------

i don't really know lots of PHP programming or MySQL administration, but I guess its quite simple. I think its just a matter of changing the "foreach" for any other instruction that would let me choose which field is printed each time, If anyone could help me, thanks!