utilitees

- Addons for ExpressionEngine 1.6.x

Splitter Documentation

Download Download

Installation:

Unzip the archive and copy the file pi.splitter.php into the plugins-directory inside your Expression Engine system-directory.

Back to top

Tag:

{exp:splitter}{/exp:splitter} 

Back to top

Parameters:

blocks="X" 

Mandatory. Sets the number of blocks you want.

class="X" 

Optional. Sets the CSS class name for the <div> surrounding a block of list items.

delimiter="X" 

Mandatory. This must be a unique string in your list that separates any two items.

Example 1

{exp:weblog:categories weblog="default" style="linear"}
 
<li><a href="{path=site/index}">{category_name}</a></li>
{/exp:weblog:categories} 

In this example the delimiter would be: </li>


Example 2-

{exp:weblog:entries weblog="default"}
 
<a href="{permalink=site/comments}">{title}</a><br />
{/exp:weblog:entries} 

In this example the delimiter would be: <br />

Example 3-

1<!-- //-->2<!-- //-->3<!-- //-->4<!-- //-->5<!-- //--> 

In this example the delimiter would be: <!—//—>

I hope you get the point wink

block_start="" 

Optional. You can specify some text that will be added at the beginning of each block, that is, after each opening <div>.

block_end="" 

Optional. You can specify some text that will be added at the end of each block, that is, before each opening </div>.

The above parameters can be used to create self-contained HTML-lists per block for example:

{exp:splitter blocks="2" delimiter="</li>" class="myclass" block_start="<ul>" block_end="</ul>"}
  {exp
:weblog:categories weblog="default_site" style="linear"}
  
<li>{category_name}</li>
  
{/exp:weblog:categories}
{
/exp:splitter} 

returns

<div class="myclass">
<
ul>
  <
li>One</li>
  <
li>Two</li>
  <
li>Three</li>
</
ul>
</
div>
<
div class="myclass">
<
ul>
  <
li>Four/li>
  <
li>Five</li>
  <
li>Six</li>
</
ul>
</
div
Back to top

A note on pagination

If you use Splitter in combination with {exp:weblog:entries} or
{exp:comment:entries} and want to use pagination you have to place special markers
inside your {paginate}-tagpair to help Splitter identify the pagination
codeblock.

Just insert <!—pagination //—> after the opening and before the closing
{paginate}-tag. The markers will be completely removed before the page is
rendered.

Example 1:

{paginate}<!-- pagination //-->
<p>Page {current_page} of {total_pages} pages {pagination_links}</p>
<!-- 
pagination //-->{/paginate} 

Example 2:

{paginate}<!-- pagination //-->
{if previous_page}<a href="{auto_path}">Previous Page</a> &nbsp;{/if}
{if next_page}
<a href="{auto_path}">Next Page</a>{/if}
<!-- pagination //-->{/paginate} 
Back to top

Questions / bug reports

For general comments, brickbats & bouquets please use the form over here.
Name:

Email:

URL:


Remember my personal information
Notify me of follow-up comments?


Page 2 of 2 pages  <  1 2

User Talk

Oliver:
2009-08-25 20:43

Is that splitter related? What are you splitting? The output of an exp:weblog:entries-tag?

If you don’t specify a limit=”” parameter in that it will default to 100. Could that be the issue at hand?



Mark:
2009-08-25 19:02

Oliver ... great plug-in!  Having one issue that I can’t seem to resolve ... once the entries in a column hit 50, it won’t display any more entries. So, if there’s 2 columns, it doesn’t display entries after 100.

How can I fix this? I’ve scoured the docs and I see no limit=‘x’ capabilities.  I would appreciate any help you can offer!  I would prefer an unlimited amount per column, if possible.

(EE 1.6.7 Build 20090211)



Oliver:
2009-03-25 10:06

With 1.2.1 this should no longer be an issue.
Are you nesting one instance of Splitter inside another?



Nico:
2009-03-19 18:24

I’m getting “Notice: Constant PAGINATION already defined in D:\export\home\bigfellow.nl\system\plugins\pi.splitter.php on line 49” when using Splitter two or more times in one page.
Any solution for this?

EE version: 1.6.7

thanks



Oliver:
2008-12-30 21:38

Yes, that’d be a nice addition I’m evaluating right now.

What makes it kinda complicated is when the text to split actually contains HTML either natively or through EE’s xhtml field formatting.
That makes splitting not as easy as it would seem at first glance.



Jaime Morrison:
2008-12-30 19:51

Hey Oliver.

Splitter is terrific. The only game in town for non-Javascript “columnizing.”

I have to ask though, would it be difficult to modify Splitter to use character count balancing rather than an explicit delimiter?

Best, and keep up the terrific work.

Jaime