?

Log in

No account? Create an account

Previous Entry | Next Entry

I don't understand theme layers. I do very well at cutting and pasting code to do this or that thing, but figuring out what the various classes and functions and *writing* my own workarounds? Even after reading the nifty S2 theme guide... no clue.

Anyways, there are a few things I had in my previous flexible squares layout that I'd like to replicate for Expressive, but I can't quite figure out how to translate the one into the other.

(1) customizing the comments links - i.e, adding or removing mem/edit/track, or reordering the links
(2) adding links to the main nav bar (Recent/Archive/Friends/Profile/Web site), removing Mem --- SOLVED
(3) adding a new section to the sidebar, such as a random quote generator

I'd also like to remove the user name from under the userpic in the "Profile" sidebar. --- SOLVED


Help?

Comments

( 5 comments — Leave a comment )
chasethestars
Oct. 21st, 2006 04:25 am (UTC)
to remove the username from under the userpic in the "profile" module:

function print_module_userprofile(string title, bool show_profile, bool show_userpic) {
var Page p = get_page();
if ($show_userpic and not $show_profile) {
if (defined $p.journal.default_pic) {
open_module("photo", $title, $p.journal.userpic_listing_url);
println """$p.journal.default_pic""";
close_module();
}
return;
}

if (not $show_profile and not $show_userpic) {
open_module("about-me", $title, $p.view_url{"userinfo"}, true);
close_module(true);
return;
}

open_module("about-me", $title, $p.view_url{"userinfo"});
print """
$p.journal.default_pic
\n\n""";
println """
""";
println """
$p.journal
""";

if ($p.journal.website_url != "") {
var string website_value = $p.journal.website_name ? $p.journal.website_name : $*text_website_default_name;
println """
$website_value
""";
}
println """
""";
close_module();
}
chasethestars
Oct. 21st, 2006 04:26 am (UTC)
(I think)
lt_kitty
Oct. 21st, 2006 03:41 pm (UTC)
Thanks, I took out two additional lines and got it to do what I wanted. :)

--------------------------

function print_module_userprofile(string title, bool show_profile, bool show_userpic) {
var Page p = get_page();
if ($show_userpic and not $show_profile) {
if (defined $p.journal.default_pic) {
open_module("photo", $title, $p.journal.userpic_listing_url);
println """$p.journal.default_pic""";
close_module();
}
return;
}

if (not $show_profile and not $show_userpic) {
open_module("about-me", $title, $p.view_url{"userinfo"}, true);
close_module(true);
return;
}

open_module("about-me", $title, $p.view_url{"userinfo"});
print """
$p.journal.default_pic
\n\n""";
println """

""";
println """
""";

if ($p.journal.website_url != "") {
var string website_value = $p.journal.website_name ? $p.journal.website_name : $*text_website_default_name;
println """
""";
}
println """

""";
close_module();
}
nimoloth
Oct. 21st, 2006 10:24 pm (UTC)
(2) Changing Header Links

You can add extra ones as I have done here - blue text. You could remove the memories one by removing the red text.

function Page::lay_print_header_links() {
# Menu start
"""<div id="message-window" class="hidden"></div>\n""";
container_open("header");
container_open("header-content");


"""<div id="header-photo">\n<div id="header-photo-inner"></div>\n</div>\n""";
"""<div id="header-text"><ul class="nav">\n""" ;

# Standard Journal Pages (Recent, Archive, Friends, Userinfo)
foreach var string v ($.views_order) {
var string url = $.view_url{$v};
var string text = lang_viewname($v);
var string class = "item";
if($v == $.view) {
$class = $class + " current";
}
if($v == $.views_order[0]) {
$class = $class + " first";
}

$class = " class=\"$class\"";

if ($text != "the past" and $text != "the befriended") {
print """<li$class><a href="$url">$text</a></li>""";
}

}

var Link memories_url = $.journal->get_link("memories");

# Memories
if($memories_url.url != "") {
println """<li class="item"><a href="$memories_url.url" title="$*text_view_memories">$*text_view_memories</a></li>""";
}


# Extra header links
"""<li class="item"><a href="http://pics.livejournal.com/nimoloth/">gallery</a></li>""" ;
"""<li class="item"><a href="http://pics.livejournal.com/manage/upload">upload image</a></li>""" ;
"""<li class="item"><a href="http://www.livejournal.com/update.bml">post</a></li>""" ;


# Menu end
"""
</ul>

<div id="header-name">""";
var string base_url = $.journal->base_url();
var string friends_url = $.view_url{"friends"};
if ($this isa FriendsPage) {
"""<a href="$friends_url"><span class="title">""" + $this->view_title() + """</span></a>""";
} else {
"""<a href="$base_url"><span class="title">$.global_title</span></a>""";
}
"""
</div>""";

if(not $this isa FriendsPage) {
"""
<div id="header-description"><span class="subtitle">$.global_subtitle</span></div>""";
}

"""
</div>
</div><span id="header-content-decor" class="decor"><b></b><u></u><s></s><i></i></span></div><!-- End Header Content -->
</div><span id="header-decor" class="decor"><b></b><u></u><s></s><i></i></span></div><!-- End Header -->""";
}
nimoloth
Oct. 21st, 2006 10:29 pm (UTC)
Oh, I forgot to say - I removed the friends and archive links with this addition that you can see in the above code:

if ($text != "the past" and $text != "the befriended") {
print """<li$class><a href="$url">$text</a></li>""";
}

but make sure you cange the text there to whatever you have set for each. Whatever text you put there determines what links will not display. This bit if code basically prints all the usual links (Recent, Archive, Friends, Userinfo) except those specified, in this case Archive and Friends.
( 5 comments — Leave a comment )

Latest Month

March 2016
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

S2 Help Communities

Tags

Powered by LiveJournal.com
Designed by chasethestars