Log in

No account? Create an account

Previous Entry | Next Entry

Editing sidebar headings- SOLVED!

  • Dec. 17th, 2006 at 10:41 PM
I've been trying to change the text of my sidebar headers, to no avail. I thought I'd found the code to do it, but it seems to not work. It's compiling with no errors, but it's also not rendering.

Here's what I've input into my custom layer:

set sidebar_primary = [
[ "userprofile", "Profil", "1", "1" ],
[ "calendar", "Dieser Monat" ],
[ "links", "Links" ],

set sidebar_secondary = [
[ "archive", "Zusammenfassung" ],
[ "tags", "Kennsatz" ],

Doesn't do a darn thing. I'm not quite sure what else to try. Any suggestions?


( 12 comments — Leave a comment )
Dec. 18th, 2006 12:06 pm (UTC)
You probably have to change the definition of the modules in the theme layer. That would work anyway, it did for me.
Dec. 18th, 2006 01:12 pm (UTC)
Exactly, depending on how your theme layer is set up, you'll probably have to put a bunch of lines like
set first_item = "none";
set second_item = "none";
etc... to keep the stuff on the "Customize Journal->Sidebar" page from overriding. Also check to make sure you don't have a layer called "Auto-generated Customizations" or similiar that might be overriding the theme layer.
Dec. 18th, 2006 04:59 pm (UTC)
so, the "none" indicates that there is no what... no title?
Dec. 18th, 2006 05:07 pm (UTC)
ok, tried that- and it removed the entirety of the sections that had the none attribute to them.


As an aside- loving the icon.
Dec. 18th, 2006 05:42 pm (UTC)
Setting "none" removes that item from the sidebar property group. This is exactly what you want to do, because the code you typed in the original post is a way of "manually" filling the sidebar_primary and _secondary objects. Without getting too technical, the code in your post is entirely correct-- I just tried it in my own layer and it worked-- but you need to stop the Expressive base code from filling the sidebar_primary object with its defaults. The way you do this is by putting your code into your theme layer, along with the lines I posted in the comment above, going from first_item up to sixth_item.

If it still doesn't work after that, try making your source viewable and we'll go from there.

Don't know who made the icon, but it wasn't the person I stole it from. ;)
Dec. 18th, 2006 06:46 pm (UTC)
ok, so, how do I have them come back then? When I set "none" a few things disappeared, but not all did. I did the none for first through sixth.

(Ignore my previous comments to this which I've deleted, I wasn't thinking straight.)
Dec. 18th, 2006 06:52 pm (UTC)
my custom layer: http://www.livejournal.com/customize/advanced/layersource.bml?id=7502874
the user generated layer: http://www.livejournal.com/customize/advanced/layersource.bml?id=7502776

So, now my layer has:
set first_item = "none";
set second_item = "none";
set third_item = "none";
set fourth_item = "none";
set fifth_item = "none";
set sixth_item = "none";

set sidebar_primary = [
[ "userprofile", "Profil", "1", "1" ],
[ "calendar", "Dieser Monat" ],
[ "links", "Links" ],

set sidebar_secondary = [
[ "archive", "Zusammenfassung" ],
[ "tags", "Kennsatz" ],

The headings haven't changed, only the profile section disappeared, and I'm thoroughly confused.

I know I've said it before, but I really appreciate your help. I am learning, slowly, but I am. I think more semantic tagging in s2 would make worlds of differences, but ah well.
Dec. 18th, 2006 09:07 pm (UTC)
That's not the module definitions. I don't have the time to look for it, they aren't in my layer anymore, but search through the provided theme layer that you started with, not your own, and look for something like "define module_something". Copy paste it into you own theme layer and make the changes in the definitions.
Dec. 18th, 2006 09:30 pm (UTC)
are you talking about these:
function print_module_calendar(string title) {
    var Page p = get_page();
    var YearMonth mon = $p->get_latest_month();
    open_module("calendar", $title, "");

    var string month = $mon->month_format();
    println """<table cellspacing="5" cellpadding="0" summary="Monthly calendar with links to each day\'s posts">""";
    println """<tr><td colspan="7" align="center"><a href="$mon.url">$month</a></td></tr>""";
    println "<tr>";

    foreach var int d (weekdays()) {
    println "</tr>";

    foreach var YearWeek week ($mon.weeks) {
        println "<tr>";
        foreach var int i (1 .. $week.pre_empty) {
            print "<td>&nbsp;</td>";

        foreach var YearDay day ($week.days) {
            print "<td>";
            if ($day.num_entries > 0) { print """<a href="$day.url">"""; }
            print $day.day;
            if ($day.num_entries > 0) { print """</a>"""; }
            print "</td>";

        foreach var int i (1 .. $week.post_empty) {
            print "<td>&nbsp;</td>";
        println "</tr>";

    println """</table>""";
    var string calendar_url = $p.view_url{"archive"};
    """<div class="widget-footer"><p><a href="$calendar_url" title="$*text_sidebar_calendar">$*text_sidebar_calendar</a></p></div>\n""";

Dec. 18th, 2006 09:50 pm (UTC)
ooh, no it's this:

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;

# 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", "Profil", "1", "1"];

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

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

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

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

# 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) {

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

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"];
if ($*base_theme == "poe" or $*base_theme == "death" or $*base_theme == "kaboom" or $*base_theme->starts_with("pixi")) {
$*sidebar_secondary[size($*sidebar_secondary)] = ["designedby",$*base_theme];

And it works! Without the other stuff I tried before!
Dec. 19th, 2006 07:49 pm (UTC)
Hah! I was just about to respond to your question with "I haven't gotten it to work yet and I haven't even tried lately", but you've answered both our questions.

Dec. 19th, 2006 03:32 am (UTC)
Sorry, I was away from the computer for most of the afternoon and evening... I actually had to do work for my job! Can you believe it? ;)

.... So I see you found a solution. It's not the one I'd have recommended, since you shouldn't have to modify the prop_init() function to get this to work. But if you got what you want and you're happy, no harm, no foul I guess.

I think the trouble might have come from your having both a theme and a user layer that were cancelling each other out. If you're making code changes to the base layout based on, say, "Poe", those changes should only go into a theme layer. A user layer is created when you apply the Customize options on top of the existing theme layer, like the unmodified "Poe".
If that was a little too confusing, there's a really good tutorial in this community.
( 12 comments — Leave a comment )

Latest Month

March 2016

S2 Help Communities


Powered by LiveJournal.com
Designed by chasethestars