Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-19 21:06:15

califfo
New Member
Registered: 2006-03-12
Posts: 9

Aligning images in article,...

Hi,…

My question is:

How do I insert an image in an article and float it right or left, with text around?

Should I surrond it with a div and do some CSS?

Last edited by califfo (2006-03-20 09:52:36)

Offline

#2 2006-03-19 21:12:46

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Aligning images in article,...

That’s one possibility. If you’re using txp:image (in the article) you can use the attributes style, align and class. With txp:article_image (in the article form) you have style and align.

Offline

#3 2006-03-19 21:20:33

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Aligning images in article,...

What I do myself is define a whole container for the body of the article. Then any images in it, will be floated (left or right, depending).

div#article-body img {
float:left;
clear:both;
}

If I want to change it, since I have a finite and few types of images, I create CSS classes like .photo, .illustration, etc. and apply specific rules to them.

Offline

#4 2006-03-20 13:52:44

califfo
New Member
Registered: 2006-03-12
Posts: 9

Re: Aligning images in article,...

Ok. Then if I have these 2 tags:

<code><txp:image align=“right” id=“3” /></code>

<p>and</p>

<code><txp:image align=“left” id=“3” /></code>

<p>How can I then make individual margins/paddings on them? Do I really have to put a “div” around?</p>

Last edited by NyteOwl (2006-03-20 19:43:33)

Offline

#5 2006-03-20 13:56:50

califfo
New Member
Registered: 2006-03-12
Posts: 9

Re: Aligning images in article,...

Dooh. I found out. I just have to use the style-attibute.

Offline

#6 2006-04-24 19:27:43

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Aligning images in article,...

Reading this thread and the faq, I decided to use the txp:image tag along with some CSS to wrap text around a left aligned image.

The articles are displaying fine but now I don’t get to see the image in article preview.

Offline

#7 2006-05-03 03:53:37

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Aligning images in article,...

You’ll need to show us what’s happening as well as the tags/style you’re using.

Offline

#8 2006-05-31 12:17:28

redneck
Member
From: Costa Mesa, CA
Registered: 2004-08-14
Posts: 37
Website

Re: Aligning images in article,...

How would one use txp:image and specify the thumbnail? For example, I have an image ID of 2, but instead of the actual image I want to show the thumbnail. I noticed that <code> <txp:image id=“2t” /> </code> doesn’t work.

I’m also looking for a way to define that thumbnail as a link to the larger image. I’m doing it now as a hack that requires a lot of HTML in the article body, and it works fine, but it would be nice to use some kind of <code> txp </code> shorthand.

Last edited by redneck (2006-05-31 12:17:43)

Offline

#9 2006-05-31 16:11:06

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Aligning images in article,...

<txp:thumbnail id="2" poplink="1" />

Offline

#10 2007-01-01 21:04:28

redneck
Member
From: Costa Mesa, CA
Registered: 2004-08-14
Posts: 37
Website

Re: Aligning images in article,...

Mary wrote:

<txp:thumbnail id="2" poplink="1" />

I know I’m late with this, but thank you for your suggestion. I’ve got it working.

Offline

Board footer

Powered by FluxBB