Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » [archived] jcb_columnize_body

#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.

If I set columns=3 with 3 items (limit=“3” for txp:article) I get :
  • Two tables in the first column
  • One table in the second column
  • None in the last column
If I modify the limit parameter of my article form with limit=“6” (see code below), I get a similar distribution only with more tables :
  • 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>

<tr> <th>Réf</th> <td><txp:title /></td> </tr> <tr> <th>Date</th> <td><txp:rei_show_custom customid=“1” /></td> </tr> <tr> <th>Lieu</th> <td><txp:rei_show_custom customid=“4” /></td> </tr> <tr> <th>Durée</th> <td><txp:rei_show_custom customid=“5” /></td> </tr> <tr> <th>Prix</th> <td><txp:rei_show_custom customid=“6” /></td> </tr>

</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 :
  1. you did add the proper CSS for two columns
  2. you tried to wrap the desired html code with <txp:jcb_columnized> tag
Questions :
  1. Did you activate the plugin after install (I know, it’s a dumb Q but it happened to me !) ?
  2. 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 ?
  3. 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

#68 2005-09-14 16:18:51

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

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

#70 2005-09-19 07:48:25

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

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

  1. Index
  2. » Archives
  3. » [archived] jcb_columnize_body

Board footer

Powered by FluxBB