Textpattern Forum

You are not logged in. Register | Login | Help

#1 2005-05-11 06:05:44

jimb
Plugin Author
From: Chicago, IL, USA
Registered: 2004-07-22
Posts: 27
Website

[archived] jcb_columnize_body

Notice: This thread is archived, this plugin is no longer available.

**********************************************************

I saw a great site today that utilized a 2-column layout. It used JavaScript to divide the body text between two divs.

I then wrote a Textpattern plugin that does the same thing, only on the server-side. To use, just swap it in for the txp:body tag, and then write css definitions for ‘leftCol’ and ‘rightCol’ that float them to one side.

More details area available on my site.

You can grab it here.

I’d like to hear people’s reactions to this plugin- I have some other ideas such as support for multiple columns, but I want to know if there is anything else that might be useful.

Jim

Last edited by jimb (2005-05-11 17:29:46)

Offline

#2 2005-05-11 14:40:04

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [archived] jcb_columnize_body

This sounds great. Do you have a working example?

Offline

#3 2005-05-11 17:05:47

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [archived] jcb_columnize_body

Hey this is a really cool idea. Hats-off to you! I’ll test and let you know how it goes.

Edit: This works just great!! Thank you again!

Last edited by creativesplash (2005-08-09 12:26:44)


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#4 2005-05-11 17:32:07

jimb
Plugin Author
From: Chicago, IL, USA
Registered: 2004-07-22
Posts: 27
Website

Re: [archived] jcb_columnize_body

Jamie-

I don’t have an example of my own just yet. But if you look at the site I linked to in the first post, you can see what is possible. It would work exactly the same way, only using the plugin in stead of a javascript.

But anyhow, I’ll put together an example and post back here when it’s done.

Offline

#5 2005-05-11 18:09:04

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [archived] jcb_columnize_body

Thanks! I already installed and have been playing with it I’ll let you know how it goes. It is looking really good though. Thanks for the contribution!

Offline

#6 2005-05-11 18:09:50

Matt
Member
Registered: 2004-02-28
Posts: 92
Website

Re: [archived] jcb_columnize_body

I’m testing it out, and it outputs div id=“LeftCol”. Shouldn’t it use a class?

Offline

#7 2005-05-11 18:28:04

Etz Haim
Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [archived] jcb_columnize_body

jimb: It would be much better if you published your plugin not as a replacement for txp:body, but as one working with this syntax:

<jcb_columnize_body><txp:body /><jcb_columnize_body/>

This way:

  • You can columnize not just article bodies, but any text at all.
  • You can use it together with my etz_pg plugin.

Just change the top of your code like this:

<notextile>function jcb_columnize_body($atts, $thing) {

$body = parse($thing);
</notextile>

And voila.

Last edited by Etz Haim (2005-05-11 18:38:27)

Offline

#8 2005-05-12 02:50:20

jimb
Plugin Author
From: Chicago, IL, USA
Registered: 2004-07-22
Posts: 27
Website

Re: [archived] jcb_columnize_body

Etz-

Good point. I haven’t done much Textpattern work recently and it never occurred to me to surround the body tag instead of replacing it. But I will make that change for version 0.2 since I think it’s a really good idea.

Matt-

I assumed that people might want to define individual styles for the two columns. But I will also add the option to output all columns with a common class name.

Thanks for the feedback both of you. I’m also going to add the ability to create a user-set number of columns, since it’s really just simple math. I’m trying to figure out a way to set columns to be of a certain height, and then create as many as would be needed to show all the content. It’s possible to guess by counting words or characters, but I would like it to be a little smarter than that. I’d like to avoid doing too much text-crunching on such large chunks of text at display time if possible.

But anyhow, version 0.2 of the plugin will be out in the next day-ish with a few new features.

Thanks again for the input everyone.

Jim

Offline

#9 2005-05-12 04:14:14

alicson
Member
Registered: 2004-05-26
Posts: 361
Website

Re: [archived] jcb_columnize_body

would this allow one to split a list of links or categories into two columns?
i’ve been waiting for that! :)


textpattern.org :: find and share Textpattern resources
textpattern.net :: TextBook – Textpattern wiki

Offline

#10 2005-05-12 04:48:23

Mary
Sock Enthusiast
From: Canada
Registered: 2004-06-27
Posts: 6,235

Re: [archived] jcb_columnize_body

That’s an excellent idea. I’ve always wondered about how to do that, but figured it was probably too difficult (read: I am lazy) to try. Kudos.

Splitting a list is different, since if you split it at all, its no longer a list, but two lists. You need to use CSS to get that kind of look.


My email address has changed recently. If you need to contact me, use the forum contact form.

Offline

Board footer

Powered by FluxBB