Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [nir] Divide column to two

Quote Reply
Re: [nir] Divide column to two In reply to
Hi,

Try this:

Global name: get_desc1_and_desc2

Code:
sub {
my @in = split /\n\n/, $_[0];

my $desc1 = $in[0];

shift @in;

my $desc2 = join("\n\n", @in);

return { Description1 => $desc1, Description2 => $desc2 }
}

Call with:

Code:
<%get_desc1_and_desc2($Description)%>
<h2>Paragraph 1: </h2>
<pre><%Description1%></pre>
<%if Description2%>
<h2>Paragraph 2: </h2>
<pre><%Description2%></pre>
<%endif%>

Should work.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Divide column to two nir 7310 Jun 22, 2008, 5:44 AM
Thread Re: [nir] Divide column to two
Andy 7160 Jun 22, 2008, 8:27 AM
Thread Re: [Andy] Divide column to two
nir 7143 Jun 23, 2008, 12:19 AM
Thread Re: [nir] Divide column to two
Andy 7126 Jun 23, 2008, 12:23 AM
Thread Re: [Andy] Divide column to two
Andy 7166 Jun 23, 2008, 12:29 AM
Thread Re: [Andy] Divide column to two
nir 7186 Jun 23, 2008, 12:37 AM
Thread Re: [nir] Divide column to two
Andy 7160 Jun 23, 2008, 12:41 AM
Thread Re: [Andy] Divide column to two
nir 7116 Jun 23, 2008, 12:52 AM
Thread Re: [nir] Divide column to two
Andy 7141 Jun 23, 2008, 12:55 AM
Thread Re: [Andy] Divide column to two
nir 7117 Jun 23, 2008, 1:01 AM
Thread Re: [nir] Divide column to two
Andy 7139 Jun 23, 2008, 1:10 AM
Post Re: [Andy] Divide column to two
nir 7089 Jun 23, 2008, 2:24 AM
Post Re: [Andy] Divide column to two
Wychwood 7086 Jun 24, 2008, 4:46 PM