?

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

( 11 comments — Leave a comment )
av8rmike
Apr. 9th, 2007 04:26 pm (UTC)
It looks like you've already set up a theme layer to create all that customtext module content. So where did you implement that customtext code to make it appear first?
aoitenshi
Apr. 9th, 2007 04:39 pm (UTC)
I put in the code for customtext but they all showed up above the Link, Tag, etc. boxes. I also don't know how to change the names of the Link, Tag, Page Summary ones. Sorry I should've been more specific.
av8rmike
Apr. 9th, 2007 05:11 pm (UTC)
You should probably make your layer public and post the layer ID#, just so I can see what's going on. Add
layerinfo "source_viewable" = 1; to your theme layer. Its layer ID# can be found on Your Layers page. It would also help to know if you are using a "User" layer as well, because any settings you've made in the "Customize Journal" wizard will take priority.
aoitenshi
Apr. 9th, 2007 05:15 pm (UTC)
I thought I did, it turns out I got the code to make it public wrong. I hope it works now. And yes, I'm using a user layer too, I think.
av8rmike
Apr. 9th, 2007 05:17 pm (UTC)
OK.... so, what's the layer number?
aoitenshi
Apr. 9th, 2007 05:21 pm (UTC)
Theme is 8408344, user is 8408418. Sorry I didn't know I had to give you the numbers - never looked into public layers before.
av8rmike
Apr. 9th, 2007 06:18 pm (UTC)
No problem-- You did everything right, as far as I can tell. Changing the sidebar order is easy; Go to Customize Journal->Sidebar, and use the pull-down boxes to set the module order to what you want. Click "Save Changes" and check things are in the right place.
Changing the titles is a little more complicated, since I don't want to make you get rid of your user layer. You'll have to edit the prop_init() function, which I'll post in a separate comment.
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.
( 11 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