Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread Hans
Friday, October 23, 2009, 11:14:24 PM, Sandy wrote: Thinking further, can this go in skin.php? $color1 = '#00cc00'; That keeps all the skin stuff in the skin, and avoids $HTMLStylesFmt[]. why don't you just set the color attributes in the skin's css file? after all, the purpose of the css

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread Hans
Saturday, October 24, 2009, 3:54:43 AM, DaveG wrote: Sandy wrote: I'm not (yet) comfortable with $HTMLStylesFmt[]. It's an array, which can contain arrays :) I thought not. I understand $HTMLStylesFmt to list css attributes, which get injected into styles.../styles tags in the page's HTML

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread Hans
Friday, October 23, 2009, 11:56:25 PM, DaveG wrote: Parse error: syntax error, unexpected T_STRING in /path/pmwiki.php(762) : eval()'d code on line 1 That's because the PageVar needed to be quoted, as Hans showed. Thus, $FmtPV['$myvar'] = 'PageVar($pagename,\'$:myvar\')' There were in

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread DaveG
Hans wrote: Friday, October 23, 2009, 11:56:25 PM, DaveG wrote: Parse error: syntax error, unexpected T_STRING in /path/pmwiki.php(762) : eval()'d code on line 1 That's because the PageVar needed to be quoted, as Hans showed. Thus, $FmtPV['$myvar'] = 'PageVar($pagename,\'$:myvar\')'

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread Sandy
DaveG wrote: Sandy wrote: I'm not (yet) comfortable with $HTMLStylesFmt[]. It's an array, which can contain arrays :) Usually you index the array with the name of the skin, but any name (or even no name) will work fine. The content of the array is output at the point in the .tmpl file

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread Hans
Saturday, October 24, 2009, 4:04:34 PM, DaveG wrote: 3. use of $pagename: use $pn rather than $pagename as $ pagename may have a different value. Not sure about this. Is $pn globally available? Not sure, but it doesn't look like it. I'd always thought $pagename referred to the current page

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread Sandy
Hans wrote: Friday, October 23, 2009, 11:14:24 PM, Sandy wrote: Thinking further, can this go in skin.php? $color1 = '#00cc00'; That keeps all the skin stuff in the skin, and avoids $HTMLStylesFmt[]. why don't you just set the color attributes in the skin's css file? after all, the

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread DaveG
Sandy wrote: Well in order to use the variable from within the template you'd need use $FmtPV: $FmtPV['$color1']='#00cc00'; So then you could use it in .tmpl (not in .css files though). Personally I prefer to use $HTMLStylesFmt. What's up with the two quotation marks? I remember

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread Sandy
DaveG wrote: Sandy wrote: Well in order to use the variable from within the template you'd need use $FmtPV: $FmtPV['$color1']='#00cc00'; So then you could use it in .tmpl (not in .css files though). Personally I prefer to use $HTMLStylesFmt. What's up with the two quotation marks?

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread Sandy
Aha! Googling the right terms helps. A way to use php to create a css file. http://www.barelyfitz.com/projects/csscolor/ Probably old news to many, but new and intriguing to me. Just checked the PmWiki docs, and yes I can have more than one php file in the skin folder. Something for me to play

Re: [pmwiki-users] Using variable in skin template

2009-10-24 Thread DaveG
Sandy wrote: Aha! Googling the right terms helps. A way to use php to create a css file. http://www.barelyfitz.com/projects/csscolor/ You could do this, but I can't help thinking you're way over complicating things... ___ pmwiki-users mailing

[pmwiki-users] Using variable in skin template

2009-10-23 Thread Sven Hartenstein
Dear pmwiki-users, I have a lot of fun discovering pmwiki and I already like it very much. One thing I can't figure out, even after reading many pages on pmwiki.org: I would like to use a variable in my skin template. Ideally, this would be similar to the (:title Title of Page:) markup, but

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread DaveG
Sven Hartenstein wrote: Dear pmwiki-users, I have a lot of fun discovering pmwiki and I already like it very much. One thing I can't figure out, even after reading many pages on pmwiki.org: I would like to use a variable in my skin template. Ideally, this would be similar to the

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Sven Hartenstein
Hi Dave, thank you for your answer! I would like to use a variable in my skin template. Ideally, this would be similar to the (:title Title of Page:) markup, but I'd be ok with using a PageTextVariable. So, is it possible to use such a variable in the skin template? {*$:MyVariable}

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Sandy
DaveG wrote: To use a PHP variable within a skin template you need to store it as a FmtPV variable, which needs to be a executable PHP statement (thus the odd quotes). Refer to PmWiki/PageVariables: $FmtPV['$MyVar'] = 'abc'; And then to use it in the .tmpl file: My quote of the day

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Hans
Friday, October 23, 2009, 8:14:27 PM, Sven Hartenstein wrote: But this would mean the variable has just one value. I would like the wiki editors to be able to set the variable differently for each page, when editing the page. Then maybe it is easiest to use div markup for those quotes, with

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Sven Hartenstein
Hi Hans, Then maybe it is easiest to use div markup for those quotes, with a specific class name, and use css to set the div where you want it. But you would need to absolutely position it. That's what I currently do. I am not very happy with it. I would prefer to set the text in the same

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread DaveG
Sandy wrote: in config.php $FmtPV['$color1'] = '#00cc00'; then in the .tmpl file: style h1 {color:$color1;} A {color:$color1;} Rather than this use: $color1 = '#00cc00'; $HTMLStylesFmt['my_skin'] = h1 {color:$color1;} ; That way, there's no need to mess with .tmpl. ~ ~ Dave

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread DaveG
Sven Hartenstein wrote: Hi Hans, Then maybe it is easiest to use div markup for those quotes, with a specific class name, and use css to set the div where you want it. But you would need to absolutely position it. That's what I currently do. I am not very happy with it. I would prefer

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread DaveG
Sven Hartenstein wrote: Hi Hans, Then maybe it is easiest to use div markup for those quotes, with a specific class name, and use css to set the div where you want it. But you would need to absolutely position it. That's what I currently do. I am not very happy with it. I would prefer

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Hans
Friday, October 23, 2009, 10:12:41 PM, Sven Hartenstein wrote: Any chance of using a PageTextVariable in the skin template? try this: add to config.php: $FmtPV['$HeaderQuote'] = 'PageTextVar($pn, HeaderQuote)'; then put the page variable {$HeaderQuote} in your skin template somewhere. and

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Sandy
DaveG wrote: Sandy wrote: in config.php $FmtPV['$color1'] = '#00cc00'; then in the .tmpl file: style h1 {color:$color1;} A {color:$color1;} Rather than this use: $color1 = '#00cc00'; $HTMLStylesFmt['my_skin'] = h1 {color:$color1;} ; That way, there's no need to mess with

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Hans
Friday, October 23, 2009, 10:12:41 PM, Sven Hartenstein wrote: Any chance of using a PageTextVariable in the skin template? you can do it even without setting a PV. just addd to your skin template somewhere: !--markup:{$:HeaderQuote}-- ~Hans

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Hans
more info about skins and skin templates: http://www.pmwiki.org/wiki/Cookbook/SkinGuidelines ~Hans ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Sven Hartenstein
Hi David, Or, you could grab the PTV into a variable, and then use it from the tmpl: $FmtPV['$myvar'] = PageVar($pagename,'$:myvar') This gives me: Parse error: syntax error, unexpected T_STRING in /path/pmwiki.php(762) : eval()'d code on line 1 Do not know what's wrong. Anyway, the

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Sven Hartenstein
This works perfectly! Thank you a lot! :-) Sven * Hans desi...@softflow.co.uk: Friday, October 23, 2009, 10:12:41 PM, Sven Hartenstein wrote: Any chance of using a PageTextVariable in the skin template? try this: add to config.php: $FmtPV['$HeaderQuote'] = 'PageTextVar($pn,

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread Sven Hartenstein
And this works perfectly, too. :-) Thank you! Sven * Hans desi...@softflow.co.uk: Friday, October 23, 2009, 10:12:41 PM, Sven Hartenstein wrote: Any chance of using a PageTextVariable in the skin template? you can do it even without setting a PV. just addd to your skin template

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread DaveG
Sven Hartenstein wrote: Hi David, Or, you could grab the PTV into a variable, and then use it from the tmpl: $FmtPV['$myvar'] = PageVar($pagename,'$:myvar') This gives me: Parse error: syntax error, unexpected T_STRING in /path/pmwiki.php(762) : eval()'d code on line 1 That's

Re: [pmwiki-users] Using variable in skin template

2009-10-23 Thread DaveG
Sandy wrote: I'm not (yet) comfortable with $HTMLStylesFmt[]. It's an array, which can contain arrays :) Usually you index the array with the name of the skin, but any name (or even no name) will work fine. The content of the array is output at the point in the .tmpl file where the