Styles are used in Coranto to format each item. Since each profile can use a different style, items can be formatted differently depending on the context the user wants to present them.

Styles use replaceable tags to add the information stored in the database into the output file. These tags act as placeholders for the content. For example:

 <Field: Subject>

will be replaced in the output file with the text that the subject field contains.

The style is processed once for each item that is included in the profile's output.

Style information is saved in crcfg.dat.

If you attempt to edit this file make sure that you have a backup.

Here is what the style info looks like:

sub NewsStyle_Default {
my $newshtml = qq~<p><strong>$Subject</strong> -- Posted by <a href="mailto:$UserField_Email">$User</a> on $Date<br>
$Text</p>
~;
return $newshtml;
}
sub NewsStyle_DefaultHeadline {
my $newshtml = qq~
<strong>$Subject</strong> -- $Month_Name $Month_Day, $Hour:$Minute $AMPM<br>
~;
return $newshtml;
}

Each style is converted to perl code and saved as a sub-routine. The sub-routine name is the style name and the style tags are replaced with their equivalent variable name.

Further reading:




Page last modified on October 27, 2009, at 06:26 PM