Adding linklist support to Gradient Strip

Apr 10, 2006 18:05

This lack has been bugging me since I switched to Gradient Strip on my other journals. An example may be seen at: http://camomiletea.livejournal.com/?s2id=10802076

First adding the function:

function Page::print_linklist() {
if (size $.linklist <= 0) {
return;
}

var bool slash = false;
var string links;

lay_nav_box_top();

foreach var UserLink l ($.linklist) {
if ($l.title) {
if ($l.is_heading) {
"""$l.title""";
$slash = false;
} else {
if($slash) {
""" $*link_divider """;
}
""" $l.title """;
$slash = true;
}
} else {
"
";
}
}

lay_nav_box_bottom();
}

Then we need to add $this->print_linklist(); to the function Page::print, as follows:

function Page::print() {
var string title = $.global_title;
var string subtitle = $.global_subtitle;
var string view_title = $this->view_title() != "" ? $this->view_title() : "Unknown View";

"""

""";
$this->print_head();
println """$title :: $view_title""";
if ($*external_stylesheet) {
print safe """""";
}
else {
"""";
}
"""
""";
$this->print_control_strip();
$this->lay_print_header();
if (viewer_sees_ads()) {
"""""";
"""""";
}
$this->print_linklist();
$this->print_body();
if (viewer_sees_ads()) {
"";
"""""";
"""
""";
$this->print_ad("Journal-Skyscraper");
"";
}
"""
""";
}

function print, class page, layout gradient strip, function print_linklist

Previous post Next post
Up