?

Log in

No account? Create an account

Previous Entry | Next Entry

Hi! I've successfully tweaked my journal's sidebar using info from the posts in this community (thanks everyone!) but I just have to tweak a couple more elements and I'm stumped on what to do now. I've browsed through the posts in the sidebar tag, but there was nothing as specific as mine. I did find bits of code here and there, but I'm not sure if they would work together, so I thought I'd post my questions:

1. How do I change the title names of the boxes?
2. How do I change the order of how they appear?

I mainly used the customtext code that somebody posted here, just in case that helps.

Comments

av8rmike
Apr. 9th, 2007 06:26 pm (UTC)
Copy & paste the whole block to your theme layer and change the blue text:
function prop_init() {
    # make array of modules
    var string[] modules = [];
    if (viewer_sees_vbox()) {
        $modules = [$*first_item, $*second_item, "ads", $*third_item, $*fourth_item, $*fifth_item, $*sixth_item, $*seventh_item];
    } else {
        $modules = [$*first_item, $*second_item, $*third_item, $*fourth_item, $*fifth_item, $*sixth_item, $*seventh_item];
    }

    # Find total of modules that are actually used
    var int total = 0;
    var string[] used_modules = [];
    foreach var string module ($modules) {
        if ($module != "none") {
            $used_modules[$total] = $module;
            $total++;
        }
    }

    # keep track of where we are
    var int count = 0;

    # figure out which module properties we're using
    var string[] properties = [];

    # cycle thru each module
    foreach var string module ($used_modules) {
        # userprofile
        if ($module == "userprofile") {
            $properties = ["userprofile", "Profile", "1", "1"];

        # mini-calendar
        } elseif ($module == "calendar") {
            $properties = ["calendar", "Latest Month"];

        # linklist
        } elseif ($module == "links") {
            $properties = ["links", "Links"];

        # tags
        } elseif ($module == "tags") {
            $properties = ["tags", "Tags"];

        # summary
        } elseif ($module == "archive") {
            $properties = ["archive", "Page Summary"];

        # syndicate
        } elseif ($module == "syndicate") {
            $properties = ["syndicate", "Syndicate"];

        # ads
        } elseif ($module == "ads") {
            $properties = ["ads", ""];

        # custom text
        } elseif ($module == "customtext") {
            $properties = ["customtext",$*customtext_title,$*customtext_body,$*customtext_url];
        }

        # Divide in half to find out which sidebar to allocate module to
        var int maxcount = $total / 2;

        # If the total can't be divided cleanly in half, add 1
        if (($maxcount * 2) != $total) {
            $maxcount++;
        }

        # index is % $maxcount to find position for sidebar
        var int index = $count % $maxcount;
        $count++;

        if ($count <= $maxcount) {
            # if count <= $maxcount, put in primary
            $*sidebar_primary[$index] = $properties;
        } else {
            # if count > $maxcount, put in secondary
            $*sidebar_secondary[$index] = $properties;
        }
    }

    # Put poweredby and designedby modules last
    $*sidebar_secondary[size($*sidebar_secondary)] = ["poweredby"];
    $*sidebar_secondary[size($*sidebar_secondary)] = ["designedby", $*base_theme];

    # Set the control strip colors
    if ($*control_strip_bgcolor.as_string == "") {
        $*control_strip_bgcolor = $*theme_bgcolor;
    }
    if ($*control_strip_fgcolor.as_string == "") {
        $*control_strip_fgcolor = $*theme_fgcolor;
    }
    if ($*control_strip_bordercolor.as_string == "") {
        $*control_strip_bordercolor = $*theme_bordercolor;
    }
    if ($*control_strip_linkcolor.as_string == "") {
        $*control_strip_linkcolor = $*theme_linkcolor;
    }
}
aoitenshi
Apr. 9th, 2007 07:56 pm (UTC)
It worked! Thank you so much for all the help!

I still can't change the order of my boxes because I made all the custom ones using the customtext code. When I choose custom text more than once from the dropdown menu (for example custom text, links, tags, page summary, custom text, custom text, syndicate), the custom boxes get duplicated. I remember there's some code for it in Component (I have to find it though), but I don't know how to change it to make it work in Expressive.

But, I can live with that. Thanks again, my journal looks perfect now. :)
av8rmike
Apr. 9th, 2007 08:00 pm (UTC)
Just go into your theme layer and re-arrange the blocks that start/end with open_module()/close_module(). In essence, you're "hard-coding" the order of your customtext blocks.
av8rmike
Apr. 9th, 2007 08:02 pm (UTC)
Oh, never mind, I see what you wanted. Yeah, if you wanted your different customtext blocks to be non-contiguous, you'd have to do some hacking of each of the individual module codes, like page summary, tags, etc.

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