Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#61 2005-09-13 10:24:12
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [archived] jcb_columnize_body
OK, this time I’m the one having a problem I can’t solve… (you can see the page here). I use 0.4 with mcbenton’s corrections.
I am using jcb_columnize with a splitontag=table parameter.
What I wanted to achieve is to have three tables display each in a column (thus 3 columns) in the yellow area (the “nouveautes” div). It seemed logical that the plugin would split after the <code></table></code> tag… but it’s not. The funny thing happening is that the plugin does some kind of “decremental dividing” of columns. I tried to toy with the minonsplit parameter, to no avail.
- Two tables in the first column
- One table in the second column
- None in the last column
- Three tables in the first column
- Two tables in the second column
- One table in the third column
I am not php-aware thus I don’t understand what is going wrong, and why this is happening…
I’d be thankful for any input as I am stuck with this…
Thanks !
Here is what I did :
Page code
<code><div id=“nouveautes”><txp:jcb_columnize splitontag=table columns=3><txp:article form=“nouveautes” limit=“3”/></txp:jcb_columnize></div></code>
Form code
<code>
<table>
</table>
</code>
CSS
.columnized1 {float: left; width: 130px; padding: 2px;}
.columnized2 {float: left; width: 130px; padding: 2px; }
.columnized3 {margin-left: 268px; width: 130px; padding: 2px; }
Last edited by davidm (2005-09-13 10:54:17)
.: Retired :.
Offline
#62 2005-09-13 11:11:10
- bartekk
- Member
- Registered: 2004-11-09
- Posts: 57
Re: [archived] jcb_columnize_body
Hi david,
i had the same problem with 2 columns.
Edit the plugin, go to line 62
<code>$thisSplit = strpos($body, $splitOnItem, $lastSplit + ($remaining/$limit-$i)) + strlen($splitonstring) +1 ;</code>
and edit the last number like this:
<code>$thisSplit = strpos($body, $splitOnItem, $lastSplit + ($remaining/$limit-$i)) + strlen($splitonstring) +3 ;</code>
now it works for me :-).
Last edited by bartekk (2005-09-13 11:11:39)
Offline
#63 2005-09-13 11:28:28
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [archived] jcb_columnize_body
OK I’ll try this and report, thanks !
Just one thing : do I modify the “original version” or the modified one ?
Edit
OK it seems to be the original version, not the one modified (see above) I have :
<code>$thisSplit = strpos($body, $splitOnItem, $lastSplit + ($remaining/$limit-$i)) + strlen($splitonstring) – 1;</code>
(except it was -1 not +1)
Edit
I tried it : my layout was blown away… I don’t get it. Tried -3 instead of +3, was a little better but not the desired effect…
I must have misunderstood what you tried to tell me…
Could you tip me on what went wrong here ?
Thanks a lot !
<span style=“color: #009900”><strong><strike>SOLVED :-)</strike></strong></span>
<em>(It break apart from 6 items and up… it works for three articles, up to five and breaks after that… )</em>
I toyed around, used the modified version and tried logic reasonning since I don’t know php :
Here is what I did… I replaced
<code>$thisSplit = strpos($body, $splitOnItem, $lastSplit + ($remaining/($limit-$i+1))) + strlen($splitOnItem);</code>
by
<code>$thisSplit = strpos($body, $splitOnItem, $lastSplit + ($remaining/($limit-$i+3))) + strlen($splitOnItem);</code>
THANK YOU for helping me out of this mess :-)))
Last edited by davidm (2005-10-02 08:49:18)
.: Retired :.
Offline
#64 2005-09-13 11:55:57
- bartekk
- Member
- Registered: 2004-11-09
- Posts: 57
Re: [archived] jcb_columnize_body
hi,
now i have the same problem like you with a div tag. My modifation works with p tag.
Where can i find the modified version?
Offline
#65 2005-09-13 12:14:11
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [archived] jcb_columnize_body
There’s no modified version per say, it’s just the few modifications proposed in this thread (see above) by mcbenton that I added to 0.4
Then I just edited mcbenton’s line with your +3 suggestion (see my last post) and there I am, it works for me now.
.: Retired :.
Offline
#66 2005-09-13 17:58:46
- -rr-
- Member
- Registered: 2005-09-11
- Posts: 73
Re: [archived] jcb_columnize_body
> davidm wrote:
> what elements did you wrap with the txp:jcb_columnize tag ? What is your CSS ?
My CSS is the one that comes with the Leaf style. I inserted .columnized1 and .columnized2 styles into it.
Then I tried wrapping everyhting I could think of in the default page code, the “wrapper”, “container”, “content”, “contentdiv” with no luck. I just want to have the front page articles go into two parrallel columns.
Apparently I have no idea what I’m doing just hacking around like a monkey with a typewriter hoping for some Shakespear to materialize :)
What I really want is to just cram the front page full of little news snippets, much like http://www.alistapart.com/ or http://www.tom.frihost.net/. How is that done?
Maybe I’m looking in the wrong direction and jcb_columnize is not what I need?
Offline
#67 2005-09-13 18:17:24
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [archived] jcb_columnize_body
No no you should be able to make it work, no reason.
Ok well let’s try to understand what went wrong here :- you did add the proper CSS for two columns
- you tried to wrap the desired html code with <txp:jcb_columnized> tag
- Did you activate the plugin after install (I know, it’s a dumb Q but it happened to me !) ?
- Did you check the html source code of the page after your changes ? No clue here ? You should see the div with columinzed1 and 2 classes in any cases… is that the case ?
- Where did you put the <txp:jcb_columnized> tags ? A sample of your HTML page and Modules would help…
Last edited by davidm (2005-09-13 18:17:59)
.: Retired :.
Offline
Re: [archived] jcb_columnize_body
rr:
Both the of the sites you mentioned have multiple collumn layouts, however, they don’t require (to my knowledge) anything like the columnizer plugin to achieve them. Having multiple columns filled with different types of content is relatively easy with some CSS. This plugin is really for splitting a lot of the same type of content into multiple columns.
Jim
Offline
#69 2005-09-18 02:29:43
- -rr-
- Member
- Registered: 2005-09-11
- Posts: 73
Re: [archived] jcb_columnize_body
Thanks for the tips. You’re right. I already discovered I don’t need jcb_columnized to do multiple columns. Took me while to figure out how it’s done, but now I do need it on another site, but I only get blank pages (no articles) just the menus.
Here’s what I did:
<code><txp:jcb_columnize columns=2>
<div id=“content”>
<txp:article limit=“1” />
<txp:if_individual_article>
<p>
<txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next>
</p>
</txp:if_individual_article>
<txp:if_article_list>
</txp:if_article_list>
</txp:jcb_columnize></code>
I put the default .columnized1 and .columnized2 in the css.
I only get blank pages. The site is just a 2-column sidebar+article page with a header and footer. Removing jcb tags brings the text back.
What am I doing wrong? (and yes the plugin is activated) :)
Offline
Re: [archived] jcb_columnize_body
Hmm, I’m not sure why nothing would be showing up. I would try to put something else inside the columnize tags to see if maybe there is something about the html that is being passed to it that is causing it to fail. If this work, post text that is being passed to the plugin and I’ll take a look at it.
And I’m not sure if it is even a problem, but the value for the caolumns attribute could use some quotes around it.
You might make sure that the tag that the plugin is looking for (p b default) exists in the text too. I never tested it to see what what would happen if the plugin never found the tag it was looking for.
Offline
#71 2005-09-19 08:44:52
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [archived] jcb_columnize_body
Something struck me in your code of what is I assume your article form : you open a div which is not closed in the form but probably later in your page with a <code></div></code> tag. Would I be wrong to assume the plugin cannot wrap an open element and thus this problem you have ?
Just an idea….
.: Retired :.
Offline
#72 2005-10-02 08:55:14
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [archived] jcb_columnize_body
This plugin still needs fixing : I thought I had pinned it but it breaks apart from 6 items and up… it works for three articles, up to five and breaks after that…
There is some kind of mathematical reasonning that I definitely lack…
A given parameter will work for some combination, but not all of them…
This line seems to be the key but we need some mathemagician to do the trick :
<code>$thisSplit = strpos($body, $splitOnItem, $lastSplit + ($remaining/($limit-$i+1))) + strlen($splitOnItem);</code>
I toyed with this part of the equation to make it work for three items and changed <code>$limit-$i+1</code> into <code>$limit-$i+3</code> but as I said the tree columns works for 1-5 items but not from 6 up…
Anyone has a clue ?
.: Retired :.
Offline