Second sidebar

Mar 27, 2011 18:45

Is it possible to have another sidebar? For the moment I have one on the right, I would love to have one on the left for the calendar, summary and tags, with the entries in the middle. I think it would be done in the "function Page::lay_print_body()" section but I'm not advanced enough to try that alone and bork my pretty layout ( Read more... )

sidebar

Leave a comment

Comments 10

fiddlingfrog March 29 2011, 01:24:13 UTC
Try this.

This bit of code removes the calendar, summary, and tags boxes from the existing sidebar:

function Page::lay_print_sidebar() {
"""
foreach var int position (1..14 ( ... )

Reply

carnifinda March 31 2011, 07:30:12 UTC
Thank you so much for your help! I didn't expect that much!
Unfortunately, I get this :
Can't define undeclared object function Page::lay_print_sidebar2()

I tried starting in a different order but LJ simply doesn't recognize this sidebar2 function...

Reply

fiddlingfrog March 31 2011, 18:16:21 UTC
Huh. I'll look into it.

Reply


fiddlingfrog March 29 2011, 01:24:28 UTC
This bit of code creates a second sidebar with only the calendar, summary, and tags:

function Page::lay_print_sidebar2() {
"""
""";
foreach var int position (1..3) {
var string pos = ""+$position;
if ($*layout_sidebox_summary_visibility==$pos) { $this->lay_print_sidebar_summary(); }
elseif ($*layout_sidebox_tags_visibility==$pos) { $this->lay_print_sidebar_tags(); }
elseif ($*layout_sidebox_latestmonth_visibility==$pos) { $this->lay_print_sidebar_latestmonth(); }
}
""" """;
}

Reply


fiddlingfrog March 29 2011, 01:25:29 UTC
And this bit of code replaces the adspace with the second sidebar:

function Page::lay_print_body() {
$this->lay_print_bodytop();
"""
""";
if (viewer_sees_hbox_top()) {
"""
""";
$this->print_hbox_top();
"";
}
"""""";
if ($*layout_sidebar_position=="left") {
"""""";
$this->lay_print_sidebar();
"""""";
} elseif ($*layout_sidebar_position=="right") {
"""""";
$this->lay_print_sidebar2();
"""""";
}
"""""";
$this->print_body();
$this->lay_print_bodybottom();
"""""";
if ($*layout_sidebar_position=="right") {
"""""";
$this->lay_print_sidebar();
"""""";
} else {
"""""";
$this->lay_print_sidebar2();
"""""";
}
"""""";
if (viewer_sees_hbox_bottom()) {
"""
""";
$this->print_hbox_bottom();
"";
}
""" """;
}

I did all this blind so let me know if something doesn't work.

Reply


fiddlingfrog March 29 2011, 01:27:13 UTC
This bit of code re-arranges the properties in customize so that the calendar, summary, and tags have their own positioning:

propgroup text_sidebar ( ... )

Reply

fiddlingfrog March 29 2011, 01:28:19 UTC

property string layout_sidebox_freetext_visibility ( ... )

Reply

fiddlingfrog March 29 2011, 01:29:37 UTC

property string layout_sidebox_freetext_5_visibility ( ... )

Reply

fiddlingfrog March 29 2011, 01:30:48 UTC

property string layout_sidebox_summary_visibility ( ... )

Reply


Leave a comment

Up