Death Kitten (diziara) wrote in s2expressive,
Death Kitten
diziara
s2expressive

  • Mood:
  • Music:

Logged in indicator.

I get annoyed with the toolbar that everyone seems to love, as it has too much stuff in too ugly of a style. So I've tried to intergrate as much of the functions I like into my style so I don't need it. The biggest thing is if I'm logged in or not. I'd fixed that in flexisquares with a "if( viewer_logged_in() ){ "x" } else { "y" } statement for a sidebar element. I'm trying to get it to work in expressive now, and I just can't figure it out.

I've got a paid account, I'm currently working with the sidebar organization solution offered by asciident in this comment, except applied to two columns.

I've tried it a couple different ways. Here's my working sidebar code before I tried to add my logged in? sidebar item:

set sidebar_primary = [
[ "userprofile", "Profile", "1", "1" ],
[ "calendar", "Latest Month" ],
[ "links", "Links" ],
];

set sidebar_secondary = [
[ "tags", "Tags" ],
[ "archive", "Page Summary" ],
[ "customtext", ">^..^<", "     "Reasonable people adapt themselves to the world. Unreasonable people attempt to adapt the world to themselves. All progress, therefore, depends on unreasonable people."
     -George Bernard Shaw" ],
[ "syndicate", "Syndicate" ],
[ "poweredby" ],
];


And when I try to put the if else statement in outside of the sidebar element, like this:

set sidebar_secondary = [
if( viewer_logged_in() ){
[ "customtext", "logged in?", "Yay! We're logged in!" ],
} else {
[ "customtext", "logged in?", "Go log in, you loser!" ],
}
[ "tags", "Tags" ],
[ "archive", "Page Summary" ],
[ "customtext", ">^..^<", "     "Reasonable people adapt themselves to the world. Unreasonable people attempt to adapt the world to themselves. All progress, therefore, depends on unreasonable people."
     -George Bernard Shaw" ],
[ "syndicate", "Syndicate" ],
[ "poweredby" ],
];


I get this error:

S2 Compiler Output at Wed Sep 13 20:16:01 2006
Error compiling layer:

Compile error: line 93, column 25: Expecting comma
S2::NodeArrayLiteral, S2/NodeArrayLiteral.pm, 59
S2::NodeTerm, S2/NodeTerm.pm, 458
S2::NodeIncExpr, S2/NodeIncExpr.pm, 41
S2::NodeTypeCastOp, S2/NodeTypeCastOp.pm, 29
S2::NodeInstanceOf, S2/NodeInstanceOf.pm, 29
S2::NodeUnaryExpr, S2/NodeUnaryExpr.pm, 40
S2::NodeProduct, S2/NodeProduct.pm, 28
S2::NodeSum, S2/NodeSum.pm, 31
S2::NodeRelExpr, S2/NodeRelExpr.pm, 29
S2::NodeEqExpr, S2/NodeEqExpr.pm, 29
S2::NodeLogAndExpr, S2/NodeLogAndExpr.pm, 29
S2::NodeLogOrExpr, S2/NodeLogOrExpr.pm, 29
S2::NodeRange, S2/NodeRange.pm, 29
S2::NodeCondExpr, S2/NodeCondExpr.pm, 29
S2::NodeAssignExpr, S2/NodeAssignExpr.pm, 29
S2::NodeExpr, S2/NodeExpr.pm, 29
S2::NodeSet, S2/NodeSet.pm, 39
S2::Layer, S2/Layer.pm, 53
S2::Compiler, S2/Compiler.pm, 27


Context

89: [ "links", "Links" ],
90: ];
91:
92: set sidebar_secondary = [
93: if( viewer_logged_in() ){
94: [ "customtext", "logged in?", "Yay! We're logged in!" ],
95: } else {
96: [ "customtext", "logged in?", "Go log in, you loser!" ],
97: }



If I try to put it inside the sidebar element, like this:

set sidebar_secondary = [
[ "customtext", "logged in?", if( viewer_logged_in() ){ "Yay! We're logged in!" } else { "Go log in, you loser!" } ],
[ "tags", "Tags" ],
[ "archive", "Page Summary" ],
[ "customtext", ">^..^<", "     "Reasonable people adapt themselves to the world. Unreasonable people attempt to adapt the world to themselves. All progress, therefore, depends on unreasonable people."
     -George Bernard Shaw" ],
[ "syndicate", "Syndicate" ],
[ "poweredby" ],
];


I get this error:

S2 Compiler Output at Wed Sep 13 19:58:47 2006
Error compiling layer:

Compile error: line 93, column 59: Expecting comma
S2::NodeArrayLiteral, S2/NodeArrayLiteral.pm, 59
S2::NodeTerm, S2/NodeTerm.pm, 458
S2::NodeIncExpr, S2/NodeIncExpr.pm, 41
S2::NodeTypeCastOp, S2/NodeTypeCastOp.pm, 29
S2::NodeInstanceOf, S2/NodeInstanceOf.pm, 29
S2::NodeUnaryExpr, S2/NodeUnaryExpr.pm, 40
S2::NodeProduct, S2/NodeProduct.pm, 28
S2::NodeSum, S2/NodeSum.pm, 31
S2::NodeRelExpr, S2/NodeRelExpr.pm, 29
S2::NodeEqExpr, S2/NodeEqExpr.pm, 29
S2::NodeLogAndExpr, S2/NodeLogAndExpr.pm, 29
S2::NodeLogOrExpr, S2/NodeLogOrExpr.pm, 29
S2::NodeRange, S2/NodeRange.pm, 29
S2::NodeCondExpr, S2/NodeCondExpr.pm, 29
S2::NodeAssignExpr, S2/NodeAssignExpr.pm, 29
S2::NodeExpr, S2/NodeExpr.pm, 29
S2::NodeArrayLiteral, S2/NodeArrayLiteral.pm, 62
S2::NodeTerm, S2/NodeTerm.pm, 458
S2::NodeIncExpr, S2/NodeIncExpr.pm, 41
S2::NodeTypeCastOp, S2/NodeTypeCastOp.pm, 29
S2::NodeInstanceOf, S2/NodeInstanceOf.pm, 29
S2::NodeUnaryExpr, S2/NodeUnaryExpr.pm, 40
S2::NodeProduct, S2/NodeProduct.pm, 28
S2::NodeSum, S2/NodeSum.pm, 31
S2::NodeRelExpr, S2/NodeRelExpr.pm, 29
S2::NodeEqExpr, S2/NodeEqExpr.pm, 29
S2::NodeLogAndExpr, S2/NodeLogAndExpr.pm, 29
S2::NodeLogOrExpr, S2/NodeLogOrExpr.pm, 29
S2::NodeRange, S2/NodeRange.pm, 29
S2::NodeCondExpr, S2/NodeCondExpr.pm, 29
S2::NodeAssignExpr, S2/NodeAssignExpr.pm, 29
S2::NodeExpr, S2/NodeExpr.pm, 29
S2::NodeSet, S2/NodeSet.pm, 39
S2::Layer, S2/Layer.pm, 53
S2::Compiler, S2/Compiler.pm, 27


Context

89: [ "links", "Links" ],
90: ];
91:
92: set sidebar_secondary = [
93: [ "customtext", "logged in?", if( viewer_logged_in() ){ "Yay! We're logged in!" } else { "Go log in, you loser!" } ],
94: [ "tags", "Tags" ],
95: [ "archive", "Page Summary" ],
96: [ "customtext", ">^..^<", "     \"Reasonable people adapt themselves to the world. Unreasonable people attempt to adapt the world to themselves. All progress, therefore, depends on unreasonable people.\"
97:      -George Bernard Shaw" ],


If anyone knows how to fix one or the other error, or if you can fix both tell me which is the better way to do it, I'd greatly appreciate it. Once I can get this squared away, I can see about getting html working in the sidebar without having to make my own copy of the expressive style layer so that I can make the "log in" link to the log in page. The html in the sidebar isn't worth cutting myself off from updates to the style.

Thanks in advance.
Tags: advanced, s2:theme layer, sidebar:custom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 9 comments