Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: Re: [shimmy1] Featured Links on Homepage: Edit Log

Here is the list of edits for this post
Re: [shimmy1] Featured Links on Homepage
I think you may find it better to do it with a loop, so:

get_the_feature
Code:
sub {
my $link_db = $DB->table('Links');
$link_db->select_options ("ORDER BY rand()","LIMIT 12");
my $sth = $link_db->select ({isFeature => 'yes', isValidated => 'Yes' });
my @loop;
while (my $link = $sth->fetchrow_hashref){
push @loop, $link;
}
return { feature_loop => \@loop } ;
}

Then in your template, have:

Code:
<%~set split = Links::Utils::column_split($feature_loop.length, 3)%>

<%loop feature_loop%>
<%~set splitmod = $row_num % $split%>
<%~if row_num == 1 or splitmod == 1 or split == 1%><dl><%endif%>
<%~include homepagelink.html%>
<%~if row_num == $feature_loop.length or splitmod == 0%></dl><%endif%>
<%~endloop%>

Untested, but 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!

Last edited by:

Andy: Mar 5, 2010, 7:48 AM

Edit Log: