:~:Dreamz:~: (celticdreamz) wrote in component_help,
:~:Dreamz:~:
celticdreamz
component_help

Component Newbie: EDITED

I'm finally trying to work my way through a custom Component layout & there are a couple things I'm having trouble with.

I used the code from this tutorial, and was able to add "memories" to the navbar. However, the navbar shows up on the top left of my layout & has a transparent background.


I will probably also be adding more components for a guest book, clock, and other goodies (once I dig through the tuts).


Since I am a complete (component) newbie, I have no clue where new codes go.


layerinfo "type" = "theme";
layerinfo "name" = "my component";

function print_my_entries(Page p, string title) {
"""<td valign="top" width="100%">""";
"""<img src="http://img214.echo.cx/img214/7761/header7tl.png">""";
$p->print_body();
} # end of Function print_my_entries


function page_layout(Page p) {
var string title = $p->title();
"""
<html>
<head>
<link rel="stylesheet" href="$p.stylesheet_url" type="text/css"/>
$p.head_content
<title>$title</title>
</head>
<body> """;


if (not $*comp_navbar or $*comp_state=="none") {
"""
<div class="navbar">
""";
print "<span class=\"header-item\"><a href=\""+$p.view_url{"recent"}+"\">$*nav_entries_text</a></span>";
print "<span class=\"header-item\"><a href=\""+$p.view_url{"friends"}+"\">$*nav_friends_text</a></span>";
print "<span class=\"header-item\"><a href=\""+$p.view_url{"archive"}+"\">$*nav_calendar_text</a></span>";
print "<span class=\"header-item\"><a href=\""+$p.view_url{"userinfo"}+"\">$*nav_info_text</a></span>";
if ($p.journal.website_url != "") {
print "<span class=\"header-item\"><a href=\"http://www.livejournal.com/tools/memories.bml?user=_high_gloss_\">memories</a></span>";
}
$p->lay_viewspec_nav(); # prints previous / next links including arrow images
"""
</div>
""";
}

"""



<table width="625" cellspacing="0" cellpadding="0" valign="top">
<tr valign="top" width="100%">
<td width="3">
<img src="http://www.livejournal.com/palimg/component/clear.gif" width="3" height="1" alt="" border="0"></td>
""";
print_my_components($p);
"""
<td width="3">
<img src="http://www.livejournal.com/palimg/component/clear.gif" width="3" height="1" alt="" border="0"></td>
""";
print_my_entries($p, $title);
"""
<td width="3">
<img src="http://www.livejournal.com/palimg/component/clear.gif" width="3" height="1" alt="" border="0"></td>
</tr>
</table>

</body>
</html>
""";
}
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 28 comments