Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-11 14:25:20

facho
Member
Registered: 2007-04-15
Posts: 64

Help with Formatting

I am still struggling with formatting some of the output of TXTPTRN. I am trying to figure out how to get text (excerpt) to align nice and tight to the article thumbnail. If you look at the following static screen, you can see what I am tying to accomplish: http://www.healthnutnation.com/template_thumbnail.jpg It’s the section in the red box (right side).

Can someone give me an idea of what this tag/code might look like? I know how to do it in XHTML, but not sure how that translates to TXTPTRN.

Thanks.

Offline

#2 2007-08-11 14:29:55

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Help with Formatting

The textpattern tags generate XHTML tags. You can change the output by adding some attributes to the textpattern tags, see Textbook
Experiment a little, then if you still can’t figure it out, post what you have as TXP tags, post what XHTML tags that generates and how you’d like it to look.

Last edited by ruud (2007-08-11 14:31:38)

Offline

#3 2007-08-11 15:10:29

facho
Member
Registered: 2007-04-15
Posts: 64

Re: Help with Formatting

Ok, so here is what I have:
<txp:permlink>
<txp:thumbnail id=“2” align=“top” /><txp:title /></txp:permlink><txp:excerpt/>

You can see the output at the very bottom of the page here: http://www.healthnutnation.com/textpattern/article/first-post

What is missing is that the excerpt is not aligning under the article title and wrapping nicely around the image. Thoughts?

Also, I had to add the image ID manually in the tag. What i want though is for this content to generate automatically based on a category. However, it does not appear that the thumbnail tag has a category attribute or anything else that i can use to tell it which articles to display.

I know I’m a total newbie, so i appreciate the help :-)

Offline

#4 2007-08-11 15:18:06

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Help with Formatting

How would you like it to look in XHTML?

btw, in the advanced options on the write tab, you can put an article_image ID and then use <txp:article_image /> to display that image.

Last edited by ruud (2007-08-11 15:20:01)

Offline

#5 2007-08-11 15:27:50

facho
Member
Registered: 2007-04-15
Posts: 64

Re: Help with Formatting

Ok, I updated the tag to <txp:article_image /> and added the image id in the advanced options. However, it is pulling up the larger version instead of the thumbnail.

I want the formatting to look like this example The thumbs onthe right within th red square is what i am after. If I can figure this out, I think i can finish my first experiment.

Offline

#6 2007-08-11 16:13:02

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

Re: Help with Formatting

facho wrote:

Ok, I updated the tag to <txp:article_image /> and added the image id in the advanced options. However, it is pulling up the larger version instead of the thumbnail.

Use the attribute thumbnail="1".

I want the formatting to look like this example The thumbs onthe right within th red square is what i am after. If I can figure this out, I think i can finish my first experiment.

Use attribute class="whatever" and style it in the CSS.

See txp:article_image.

Offline

#7 2007-08-11 16:14:27

facho
Member
Registered: 2007-04-15
Posts: 64

Re: Help with Formatting

Thanks, I’ll give it a try! that might just be the clarification I needed.

Offline

#8 2007-08-11 16:15:52

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Help with Formatting

Use <txp:article_image thumbnail="1" />

Something like this perhaps:

<div>
  <txp:article_image thumbnail="1" style="float:left" />
  <txp:title />
  <txp:excerpt />
  <txp:permlink>Read more...</txp:permlink>
</div>

Offline

#9 2007-08-11 16:44:50

facho
Member
Registered: 2007-04-15
Posts: 64

Re: Help with Formatting

THANK YOU! That gets me very close to exactly what I need. I think I can figure out the details (linking the title and image.) Thank you SOOOO much. I’ve spent far too long trying to figure this simple task out. I owe you a cold one bro (anytime you’re in WA).

Offline

#10 2007-08-11 20:06:52

facho
Member
Registered: 2007-04-15
Posts: 64

Re: Help with Formatting

One last request. I’ve been trying to figure out how I can have the tags post the 3 most recent article based on a category name using

<txp:article_image thumbnail=“1” style=“float:left” class=“adimages” /> <txp:permlink class=“adtitles”><txp:title /> </txp:permlink><txp:excerpt /><txp:permlink>Read more…</txp:permlink>

I’ve looked through the documentation and from what i can tell, none of these particular tags allow for the “category” attribute. What’s missing?

Offline

#11 2007-08-11 20:10:14

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Help with Formatting

<txp:article_custom form="some_form" category="some_category" limit="3" sort="Posted DESC" />

where the “some_form” contains:

<txp:article_image thumbnail="1" style="float:left" class="adimages" />
<txp:permlink class="adtitles"><txp:title /></txp:permlink>
<txp:excerpt />
<txp:permlink>Read more…</txp:permlink>

Last edited by ruud (2007-08-11 21:26:31)

Offline

#12 2007-08-11 20:18:46

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Help with Formatting

Read more documentation, and you will get it. But here goes.

Create article-form named article-list, and put there code of yours:

<txp:article_image thumbnail="1" style="float:left" class="adimages" />
<txp:permlink class="adtitles"><txp:title /></txp:permlink>
<txp:excerpt />
<txp:permlink>Read more…</txp:permlink>

Now let’s call the three most recent articles based on category. Put this where you want to add the list.

<txp:article_custom category="category name" limit="3" sortby="Posted DESC" form="article-list" />

Cheers!

Edit: Damn, ruud was faster by couple of minutes :D I was writing my answer when he posted his. Well, heh :-)

Last edited by Gocom (2007-08-12 07:25:29)

Offline

Board footer

Powered by FluxBB