Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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