Image Block widget?

BuddyRich

Joined: 2007-11-22
Posts: 4
Posted: Thu, 2007-11-22 15:03

How do I get the image in the widget centered to the block?

If I get a landscape image its not so bad but if I get a photo taken in potrait, its looks like its left-justified. This is likely a problem with my wordpress theme, I realize.

Also when I goto the (embedded) Gallery Page itself, how would I get it to show in the whole center column. It looks like it is reserving space on the right side for a column? I am using the latest wpg2 embedded theme for gallery2 from the wesnapshot.zip file...

Check out www.davewoods.ca for an example.

 
BuddyRich

Joined: 2007-11-22
Posts: 4
Posted: Thu, 2007-11-22 17:02

Alright. I have played around with firebug and found out a big more...

It is a problem with the style-sheets and the img tag and its handling of align.

The problem is that the image block widget is just a div container with an a , img and p tags. As such the img tag will ignore the text-align attribute (but the p stuff is centered) if it is added to the .wpg2sidebarblock-image class

I can edit the underlying styles.css for the wordpress theme so all stuff in the right sidebar is centered, but then it affects everything in the sidebar and I don't want that.

Is there a file I could edit that would wrap a <p> tag around the img tag in the image block wigdet that would then accept the text-align so I can center just the image and not the photo title and other info that is in the other p tag?

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sat, 2007-11-24 01:50

Yes edit the sidebar widget code in wpg2widgets.inc and add a <p> around the output block..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
BuddyRich

Joined: 2007-11-22
Posts: 4
Posted: Sat, 2007-11-24 15:42

Thanks for the help. I had eventually found that file.

I tried that, and it worked, however it appears that that template is used to generate the HTML for all image insertions into wordpress, not just the widgets, so posts with multiple inserted images would appear as separate paragraphs, one after another, rather than inline. So adding a <P> tag broke more than it fixed. :-)

I did find out a way to do what I want via .css though:

In wpg2.css I made the following changes to .wpg2sidebarblock-image:

.wpg2sidebarblock-image {
display:block;
margin-left: auto;
margin-right: auto;
text-align:center;
}

By setting the margins to auto it centers stuff within its container.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Mon, 2007-11-26 02:02

Even Better solution, CSS is your friend :) BTW you can have a custom wpg2.css file located in your Wordpress Theme, just copy the file and revalidate WPG2

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Fri, 2008-01-11 18:56

Thanx BuddyRich,

I tried to change the position of that block for hours, I knew it had smth to do with the sidebarblock but did not know what to write, tried to add the margin but without changing the display from inline to block. You saved my life, not exactly with you solution cuz yours does not change anything for me (don't know why) but this helped me :

.wpg2sidebarblock-image {
display:block;
margin-left: 20px;
}

;-)

As Ozreg says : CSS is our friend !

 
meetarnav

Joined: 2008-03-15
Posts: 17
Posted: Sat, 2008-03-15 20:07

my blog www.arnav.bookrum.com the gallery is embedded on "Test PAGE" and its mis-aligned(towards right) It seems you ppl are discussing something i might use...?? My coding know-how is VERY limited.

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Sun, 2008-03-16 10:08

This does not seem to be a imageblock problem but you should find your answer over here :

http://gallery.menalto.com/node/70266