Shrinking and Centering/Header Image

Jul 25, 2004 21:32

this is both a public apology to eternaldaydream and a tutorial.
i would first like to apologize to eternaldaydream to how my previous entry was presented. i know that what i intended it to mean isnt as powerful as what it actually meant to her.

if you notice, i removed the links that directly linked to the other page.
my intent for that entry of mine was to state that i was annoyed at the reposting of questions that happens constantly at times.
this is in no way directed at only her, but all of you guys who dont go back and read.
i would also like to think that those people who come up with new nifty ideas would post a top level entry (like this) that says "hey! heres how you do this nifty thing that i came up with in comments on another entry!"

... putting that aside... i have a new tutorial.

i nabbed the base of this from masterslacker's recreating the navbar tutorial.

and i got a spiffy tip from eduthepenguin to just put everything in one bigass table... awesome.
i dont understand you people. :P

update [mar 30, 2005]:
removed warnings for header image junk. added vars to top for header image url and alt text.
completely re-did nav links section to hopefully make it easier to add custom links.

update [jan 30, 2005]:
if the content of your entries is wider than the width you have set for your journal, it will expand. period. you need to fix your entries so that the overflow is set to auto so scrollbars will activate when needed.

add border="0", cellpadding="0" and cellspacing="0" to $k1Swidth . w00t.

#

###################################
# SHRINKING AND CENTERING #
# kunzite1, component-help/248593 #
# overrides page_layout(Page p) #
###################################
function page_layout(Page p) {
# Set this to the width that you want both the navbar (if it exists) and the whole journal to be
# may be percentage (70%) or number of pixels (700px).
var string k1Swidth = "70%";
var string k1Sheader_url = ""; # optional header image url
var string k1Sheader_alt = ""; # optional header image alt text

# Start the html document and print the head section which controls the page title, stylesheet information,
# server supplied head content, and custom header informtion from the print_custom_head function.
var string title = $p->title();
"""

""";
$p->print_head();
"""
$title

""";

# Start the body section of the html document which controls the visible parts of the page.
"""style="text-align:center;">""";

if($k1Sheader_url != "") {
"""

""";
}

if($k1Swidth != "") {
"""""";
}

# Print the navigation bar if it is needed. This can be incorporated into any other tutorials which override
# the page_layout() function, and should be placed immediately after the tag above.
if (not $*comp_navbar or $*comp_state=="none") {
"""
""";
var string[] views_order = ["recent", "friends", "archive", "userinfo"]; # view order
# "recent" = recent view
# "friends" = friends view
# "archive" = calendar view
# "userinfo" = userinfo link
var string{} view_text = { # build text hash
"recent" => $*nav_entries_text,
"friends" => $p.journal_type != "C" ? $*nav_friends_text : $*text_view_friends_comm,
"archive" => $*nav_calendar_text,
"userinfo" => $*nav_info_text
};
var string base_url = $p.journal->base_url(); # get base url
var string{} view_url = { # build url hash
"recent" => "$base_url/",
"friends" => "$base_url/friends/",
"archive" => "$base_url/calendar/",
"userinfo" => "$*SITEROOT/userinfo.bml?user=$p.journal.username&mode=full"
};
foreach var string v ($views_order) {
print """ $view_text{$v}""";
}

# to add your own links you can use these as a templates
# print """ memories""";
# print """yahoo!""";

if ($p.journal.website_url != "") {
print " $p.journal.website_name";
}
$p->lay_viewspec_nav(); # prints previous / next links including arrow images
"""

""";
}

# Print a spacer at the top of the page above the components and main area.
"""

""";

# Start the table which lays out the components and main area in side-by-side layout
"""



""";

# If the components are supposed to be on the left side of the page, then print them, followed by a column
# with a spacer which is to seperate the components and the main area.
if ($*comp_state == "left") {
print_my_components($p);
"""



""";
}

# Print the main area of the page.
print_my_entries($p, $title);

# If the components are supposed to be on the right side of the page, then first print a column with a spacer
# and then print the components after the spacer.
if ($*comp_state == "right") {
"""



""";
print_my_components($p);
}

# Finish off the table for the body
"""



""";

if($k1Swidth != "") {
"""""";
}

# End the body section and end the html document
"""

""";
}
#

user: kunzite1, admin: deprecated

Previous post Next post
Up