Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
Multiple CSS
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/18/12 05:24 
Has anyone found an easy way to allow a user to choose a skin layout?

Basically I want to copy the existing CSS and then create a custom firm field for them to chooses. I tried this in the header file but was unable to get it to work before I needed to head out. I will look at it again tonight but thought I would see if anyone had any luck.

I have seen the switcher.js version and suppose I could do a drop down menu on the index page but would really prefer it tied to the user so it changes on login.

Thanks!!

Back to top
boplive



Joined: 03 May 2006
Posts: 817

Posted: 05/18/12 06:18 
I tried the switcher .js along time ago..in one of my sites...and it worked well..with the help of SteveX.

NOW REGARDING THE BOTTOM

Arrow I have seen the switcher.js version and suppose I could do a drop down menu on the index page but would really prefer it tied to the user so it changes on login.

are you looking to have a different background on each page as you switch pages or like you mentioned in the beginning of your post...skin switcher...
its kind of 2 different things that your asking for. Wink

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/18/12 06:37 
Thanks for the reply. Consider having multiple themes. The user can change themes in the control panel. What I want is the same thing but at a site level. When I said "skin" I mean layout not JR skins.

So right now I have projam2.css. I want to mark that up with different images and colors and say call it projam2-blue.css. I want the user to be able to go in to the control panel and choose default or blue from a drop down custom form field. Either from a user level or artist level. So I could write a conditional statement in the header file based on the custom form field. I tried that this morning but had to run to work so I did not get a chance to finish.

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 05/19/12 04:08 
Check out Nova Dazed, it uses a skin config setting to change the different CSS files, but could easily be changed to use a custom form field variable.

Hope this helps,
Douglas


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/19/12 12:33 

SixString:
Check out Nova Dazed, it uses a skin config setting to change the different CSS files, but could easily be changed to use a custom form field variable.

Hope this helps,
Douglas


cool thanks Douglas. Every time I think my master css is done, I change something. Always the way isn't it? Once I get that done, it should be pretty easy. Right now I setup the switcher and it works but I would really prefer they set it at an account level so it is permanent.

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/19/12 19:16 
Douglas where is this in Nova?

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 05/20/12 06:02 
Its in the jr_header.tpl file...


Code

{if $smarty.config.site_style == 'Cocoon'}
<link href="{jr_css_src skin="Nova" config="css_cocoon.php"}" rel="stylesheet" type="text/css" media="screen">
{elseif $smarty.config.site_style == 'Diamond'}
<link href="{jr_css_src skin="Nova" config="css_diamond.php"}" rel="stylesheet" type="text/css" media="screen">
{elseif $smarty.config.site_style == 'Red_Nebula'}
<link href="{jr_css_src skin="Nova" config="css_red_nebula.php"}" rel="stylesheet" type="text/css" media="screen">
{else}
<link href="{jr_css_src skin="Nova"}" rel="stylesheet" type="text/css" media="screen">
{/if}


instead of checking the smarty config variable, check your custom form field variable...


Code
{if $YOUR_VARIABLE == 'name_of_css_style'}
<link href="{jr_css_src skin="Nova" config="css_cocoon.php"}" rel="stylesheet" type="text/css" media="screen">

etc...


Hope this helps,
Douglas


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/20/12 06:42 
Hey Douglas! That was actually what I tried first since ProJam2 has the same setup. The problem I had was that when using a custom form field, it did not change anything. I tried a band and user custom form field with no luck. I am assuming it can't be changed at that level?

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 05/21/12 05:49 
Most likely the custom form field variable is not available in the header template. You could always do a ranking call in the header to get the variable though... maybe something like:

{jr_ranking mode="user" user_id=$_USER.user_id row_template="user_css_row.tpl" assign="USER_CSS"}

then in the user_css_row.tpl add your custom USER form field variable... then you should be able to check the variable {$USER_CSS} for the css style.

Hope this helps,
Douglas


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/21/12 06:58 
Awesome! I will give it a shot!

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/21/12 19:10 
Well it seems like it should work! It will display Black but blue does not get displayed. Anything you see missing?

user_css_row.tpl

Quote:
{$USER_CSS}


I ran a debug on it and it reads "Blue" or "Black" so that is good.
ie. user_css => "Blue"
user_css => "Black"

index_header.tpl

Quote:
{if $USER_CSS == 'Blue'}
<link href="{jr_css_src skin="ProJam2" config="css_light.php"}" rel="stylesheet" type="text/css" media="all">
{else}
<link href="{jr_css_src skin="ProJam2" config="css_dark.php"}" rel="stylesheet" type="text/css" media="all">
{/if}


css_light.php - my css is ProJam2_Blue.css


Quote:
<?php
// css.php - Skin CSS definitions
defined('IN_JAMROOM') or exit();

// Full path to CSS file => minify/no_minify/code
$_css["{$jamroom['jm_dir']}/skins/ProJam2/ProJam2_Blue.css"] = 'minify';
$_css["{$jamroom['jm_dir']}/skins/ProJam2/js/lightbox/lightbox.css"] = 'minify';
// No closing PHP tag is needed!


Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 05/21/12 21:08 
are you sure that {$USER_CSS} is sometimes equal to 'Blue'?

Try outputting:

Code
User Css is : {$USER_CSS}


to see what is in that value.

-- edit --
my guess is that the var you want is {$_USER.user_css}
{if $_USER.user_css == 'Blue'}......


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/21/12 21:26 
That did it!

Thanks All!!!

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/22/12 04:36 
Now for hopefully my last question. The conditional statement seems to be pretty straight forward and not much different from the old one. Why is it when using the 'Blue' template does my site come to a grinding halt? I checked the logs and nothing was there. The page loads are will into the 30-60 sec range where on 'Dark' they are a few seconds. I know building cache could be part of it but even when I refresh it is the same slowness.

Thanks!

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/23/12 17:28 
Thanks again for the help guys. I played with it a bit more and it just ran so slow on my site. I am not sure what the real difference was between the existing call and new call but it was not feasible. The dev site ran great but there was only one user there.

Appreciate the help!

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.