![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
Is it possible to set a variable to be another variable?
That is, instead of:
set color_thing = "#333366";
doing:
set color_thing = $*some_other_thing;
such that the default value of $*color_thing is equal to the value of $*some_other_thing, but with option for user to override?
That is, instead of:
set color_thing = "#333366";
doing:
set color_thing = $*some_other_thing;
such that the default value of $*color_thing is equal to the value of $*some_other_thing, but with option for user to override?
Tags:
no subject
Date: 2009-11-17 05:47 pm (UTC)no subject
Date: 2009-11-17 06:15 pm (UTC)no subject
Date: 2009-11-17 06:39 pm (UTC)no subject
Date: 2009-11-17 06:46 pm (UTC)if $x = "" { $x = $y } else { $x = $z }
...or something like that. I'm thinking back to the "leave blank for default" discussion elsewhere (per the wizard), and that if the user left the entry blank, then the default would prevail. In which case, the input -- $x -- would be = "" instead of = "user-input".
*ponders*
no subject
Date: 2009-11-17 06:42 pm (UTC)thing-x { color: $*color-thing-y; }
Sorry for not thinking it through.
Um, I don't think you can temporarily define functions in themes? I know that you can create variables inside the print stylesheet functions, though. I don't know exactly how it's done, alas.
no subject
Date: 2009-11-17 06:48 pm (UTC)set this_value = "200";
and then in the theme it says:
set this_value = "300";
the layout would take the latter and overwrite the former, correct?
no subject
Date: 2009-11-17 08:29 pm (UTC)The thing that I don't think you can do, which I think you want to do, is say set this_value=y and in a function, set user_controlled_value=this_value
And then have there be an effect when the user changes the user_controlled_value through the wizard. I could be wrong about that, though.
no subject
Date: 2009-11-17 09:43 pm (UTC)-- layout defines property $X
-- layout sets $X = 'blue' ---> default value
-- theme sets $X = 'green' ---> default value for theme
-- user sets $X = 'red' ---> overrides all of the above
Right? So if instead of setting $X in the theme, I define it in the layout like so:
-- layout defines property $X
-- layout defines property $Y
-- layout sets $X = 'blue' ---> default value
-- layout sets $Y = true
-- layout function sez:
... if $Y is true, $X = 'blue', else $X = $Z
-- theme sets $Y = false
-- theme sets $Z = green
-- user sets $X = 'red' ---> overrides all of the above by setting $Y as true and $X as red, theme value is ignored
... OR I could just say to hell with it and do it long-hand, because this is like spending twenty dollars to save ten cents, isn't it.
no subject
Date: 2009-11-18 02:36 am (UTC)layout:
property Color X { des = "base value" }
property Color Y { des = "falls back on base value if not provided" }
set X = "blue"
set Y = ""