Headlines and Teasers Side by Side

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Headlines and Teasers Side by Side

Postby Astradyne » Fri Sep 14, 2007 1:51 am

I'm currently running Coranto v1.24 (I know I ought to upgrade, but haven't found the time yet) with GuestPost, Maginot, News Categories and a couple of other add ons installed.

I seem to recall seeing documentation on the old Coranto site that explained how to get items to appear side by side across the page rather than in a single column.

I want to set up a page with images/videos that are added as "articles" in Coranto and to have them appear in a table row with up to four cells across.

Can anybody point me in the direction of the documentation if it still exists, or suggest a method on how it would be achieved? I vaguely remember the use of Perl code in the style that kept count of the entries so far and then conditioned the end of table rows, etc? Does that sound likely?

Thanks in advance.

Jonathan
Astradyne
 
Posts: 36
Joined: Wed Jan 10, 2007 4:17 pm
Location: Cheshire, UK

Postby Jackanape » Fri Sep 14, 2007 2:38 am

I believe you're looking for the "News Columns" addon by Sumaleth. You can download it via the link at the top of the page. There's many topics that cover the how-to's here in the forum, as well...

Good Luck, and keep us posted!
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Astradyne » Sun Sep 16, 2007 3:34 pm

Hi Jackanape

Thanks for that, I did some more searching and found an entry on counting the news items, so plagerised a little code from there and dug out a Perl manual to come up with the following style:

Code: Select all
<PerlCode>
if (not $counter) {
$counter = 1;
}
</PerlCode>

<If: Field: counter == 1>
<table cellpadding="5" cellspacing="5"><tbody><tr valign="top">
</If>

<td width="300">

<span class="bodytext">
<Field: Text><br>
</span>
<a class=headline onmouseover="this.style.color='red'" onmouseout="this.style.color='black'" href="http://<TextField:  CustomField_URL>"<Field: counter>
<If: Field: CustomField_New_Window eq "Yes">
target="_blank"
</If>
><Field: Subject>
</a>
<If: Field: CustomField_New_Window eq "Yes">
<img src="images/globe.gif" width="12" height="12">
</If>

<br><br>
</td>

<PerlCode>
$counter++;
if ($counter == 4) {
$counter = 1;
}
</PerlCode>

<If: Field: counter == 1>
</tr></tbody></table><br>
</If>


Basically, I've added some of the kids favourite YouTube videos as articles on the family website (under "Links/YouTube" if anyone's interested).

It's working nicely and putting three videos across the page, but it's also having an impact on the page footer which is something I need to sort out.

Anyway, thanks again.
Astradyne
 
Posts: 36
Joined: Wed Jan 10, 2007 4:17 pm
Location: Cheshire, UK

Postby Jackanape » Sun Sep 16, 2007 8:12 pm

Bravo, sir!

Very nice work...
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Dale Ray » Sun Sep 16, 2007 9:27 pm

Astradyne,

You may want to check out:

Flexible Tables

Counters in Coranto Styles

In particular read this section:

Code Portability - Avoid Unexpected Conflicts
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana


Return to Customization

Who is online

Users browsing this forum: No registered users and 2 guests

cron