Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [archived] jcb_columnize_body
> davidm wrote:
Also I have a very dumb question but it struck me : How do you make the css columns work with the plugin set to a unique class (classes=unique parameter) ? e.g how do you set the float, you can not define the unique class to float since you can’t have a floating element based on another floating element if I remember correctly ? Maybe use pseudo class :after ?
I didn’t think of this, but we have to define one more CSS example for parameter classes=unique
What about floating all your columns ?
.columns {float:left; width: 250px; padding: 5px;}
And then give them a margin-right to create a gutter ?
That is how I implement most of my column designs.
And what would you like to do with :after ? This pseudo class is not adressing the ‘next block element’ as you seem to imply. It only generates something, in relationship to the current element.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#47 2005-06-09 10:55:22
- davidm
- Member

- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [archived] jcb_columnize_body
phiw13, I guess you’re right, couldn’t work assigning a column class for the first column, and a column:after for the following ones… this would be self-referencing, indeed…
<blockquote><strong>phiw13 wrote</strong> : What about floating all your columns ?
.columns {float:left; width: 250px; padding: 5px;}</blockquote>
Could work, yes… I you say it works for you…
I just thought a floating element was floating in relationship with a non-floating one (?)
That’s my my sample CSS has a first non-floating element. Could you try to give a working solution, cause I don’t see how it would work with dynamic content if I don’t define a height for the parent element (which in turn will cause overflow problems…). I guess we need a John Hicks there ! John ? I am just a padawan, not a CSS master ;-)
Also one of the concern is cross-browser problems (like IE float bug).
Ahhhh, I wished we already had CSS3 mutiple-column model !!!
Last edited by davidm (2005-06-09 10:57:50)
.: Retired :.
Offline
Re: [archived] jcb_columnize_body
> davidm wrote:
Ahhhh, I wished we already had CSS3 mutiple-column model !!!
I do use that already :-)
Visit the site in my sig (emps.l-c-n.com), in the article section, and select the alternate stylesheet.
You’ll need a recent nightly build of Firefox for it to work however (the DeerPark alpha release will do).
Although, I’m not convinced that multicolumn text is the best solution for onscreen text. I implemented it on that site, for fun and for testing purposes, I’ve tweaked quite a bit since first implementing that (and filed some bugs in Bugzilla as well). I see multi-column layout as much more useful for projection or print media. I’ll use it for printed docs for an important paid gig, once Firefox 1.1 comes out, this summer somewhere.
Now to the suject at hand: I suggested to float all columns left, as this avoids most of the problems with that one browser (you know, that one). Then floated blocks must come first in the source (in reference to the parent block). A very quick dummy.
For dynamic content, you’d need to calculate how much content goes into one column, and dynamically insert breaks (javascript seems the best option here) to port the overflowing text to a second column, and the next column, and the next,… That is what the IHT newspaper does, IIRC — I haven’t checked for a while how that site behaves.
You’ll need to define height somehow for it to work.
I think that is what you attempt to do, at least.
Last edited by phiw13 (2005-06-09 12:36:08)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: [archived] jcb_columnize_body
0.4 is available.
It introduces the ability to split by using a certain string instead of an html tag. Right now the plugin only properly works with paragraph tags in this mode- it will become more universal after the follow feature is working:
Splitting based on a certain number of words is still coming. Things become complicated because this can generate very bad html unless the script is very careful. If a certain word count is reached inside an html element, that element must be closed before the div can be closed. For paragraphs this is simple, but for nested elements, such as list items, it is a little more involved, and I haven’t had time to finish it yet.
I also did a lot of work on the help, so please check it out and let me know what you think.
As for the javascript columnizing plugin, I have been working on it a little (when not searching wildly for a new apartment), and I think I will be changing/adding some features to make it work better from within TXP. What features would you like to see in it? It will already handles paging, are there any others? When it is ready it will be released under a new name to avoid confusion.
And davidm: thanks for catching all my help mistakes.
Last edited by jimb (2005-06-10 05:00:09)
Offline
#50 2005-06-10 19:11:51
- steventer
- Member
- Registered: 2004-12-03
- Posts: 56
Re: [archived] jcb_columnize_body
Excellent work — I look forward to testing the javascript version, Jim.
Offline
Re: [archived] jcb_columnize_body
Fantastic plugin Jimb. Found a couple of glitches in 0.4:
line 60 was:
<code>$thisSplit = strpos($body, $splitOnItem, $lastSplit + ($remaining/$limit-$i)) + strlen($splitonstring) – 1;</code>
I changed it to:
<code>$thisSplit = strpos($body, $splitOnItem, $lastSplit + ($remaining/($limit-$i+1))) + strlen($splitOnItem);</code>
I also deleted the “+ 1” on lines 73 and 84.
This fixes several things:
1. $splitonstring was supposed to be $splitOnItem (probably just a typo during the revision)
2. I think it was unnecessary to use the “-1” since you just added it back again on lines 73 and 84 (definitely correct me if I missed something there).
3. The variable $remaining needs to be divided by the number of columns left to be processed. If $limit is the total number of columns and $i is the current column being processed, then $limit – $i +1 equals the number of columns left to be processed. For example, if you want 10 columns and you are currently processing column 7 ($limit = 10, $i = 7), then $remaining needs to be divided by 10 – 7 + 1 = 4. This should work for an arbitrary number of columns.
Hope this helps! Thanks again for creating this one!!!
Cheers,
Morgan
Offline
Re: [archived] jcb_columnize_body
This plug-in is a heaven send…provided that I can get it to work as expected. (And I can see that plenty of people have gotten it to work as expected, so I’m sure it’s something I am doing.)
I’m having some trouble with it on: http://www.tnri.net/newdesign/
I’m using v0.4 with Morgan’s corrections. In the default form, I’ve wrapped the txp:body tag as follows:
<txp:jcb_columnize><txp:body /></txp:jcb_columnize>
However, I’m not getting the 2 column look I expected. What am I missing?
Thanks!
Offline
Re: [archived] jcb_columnize_body
> ywickham wrote:
> I’m having some trouble with it on: http://www.tnri.net/newdesign/
Nevermind. I must have been caching. It’s working!
Thanks for the plug in!
Offline
Re: [archived] jcb_columnize_body
Well, I take that back. I do have an issue, still. I thought I had seen a reference to it in this thread, but skimming back over it I can’t find that reference.
If I have a short article with say just two “p” tags, it seems that I have to have more than half of my text within the first “p” tag in order for the columns to split properly. Otherwise, I get one column with my whole article and another column that is just blank.
Anyone experience that?
Offline
#55 2005-09-05 18:20:56
- bartekk
- Member
- Registered: 2004-11-09
- Posts: 57
Re: [archived] jcb_columnize_body
Hi,
is this plugin working with txp4?
How can i use this plugin.
Is it like this?
<code><txp:jcb_columnize><txp:body /><txp:jcb_columnize/></code>
I get an error:
Warning: Missing argument 2 for jcb_columnize() in /home/httpd/vhosts/domain.com/httpdocs/kunden/textpattern/lib/txplib_misc.php(429) : eval()’d code on line 1
Last edited by bartekk (2005-09-12 00:47:39)
Offline
#56 2005-09-11 23:19:23
- -rr-
- Member
- Registered: 2005-09-11
- Posts: 73
Re: [archived] jcb_columnize_body
I’m getting exactly the same error:
Warning: Missing argument 2 for jcb_columnize() in /var/www/sites/demo.com/textpattern/lib/txplib_misc.php(429) : eval()’d code on line 1
Last edited by -rr- (2005-09-11 23:25:33)
Offline
#57 2005-09-12 00:51:08
- bartekk
- Member
- Registered: 2004-11-09
- Posts: 57
Re: [archived] jcb_columnize_body
just edit the plugin
from
<code>function jcb_columnize($atts, $thing) {</code>
to
<code>function jcb_columnize($atts, $thing=’‘) {</code>
now it works.
Offline
#58 2005-09-12 06:54:24
- davidm
- Member

- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [archived] jcb_columnize_body
bartekk, thanks for the much needed tip :-) !
.: Retired :.
Offline
#59 2005-09-12 13:31:54
- -rr-
- Member
- Registered: 2005-09-11
- Posts: 73
Re: [archived] jcb_columnize_body
Thanks. Got rid of the error but I still cant make it work.
Sorry for the noobiness, but “To use this plugin, surround what you want to be columnized with the tag txp:jcb_columnize” isn’t much help to me.
I’m using the Leaf style and I’ve tried to surround the article content in the “default page” in different ways. I get various results, but just can’t figure out how to actually get two nor three columns out.
Real world examples of complete code would be REALLY helpful. ???
Offline
#60 2005-09-13 08:12:26
- davidm
- Member

- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [archived] jcb_columnize_body
No problem, these questions will help others with the same problem… the first question is : what did you try ? what elements did you wrap with the txp:jcb_columnize tag ? What is your CSS ?
Last edited by davidm (2005-09-13 10:08:10)
.: Retired :.
Offline