Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 23 Jul 2014, 18:42
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Limit a widget to certain style?

How can I limit a cms widget to a particular style?

The problem is I have only one light style and I design any widgets for the dark styles as there are more of them. I know I should stick with one style but I just can't choose .... they are all my babies
__________________

Reply With Quote
  #2  
Old 23 Jul 2014, 18:50
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Real name: Zachery Woods
Why not just fix the widget in the style?
__________________
Looking for ImpEx?
Reply With Quote
  #3  
Old 23 Jul 2014, 20:14
tbworld tbworld is offline
 
Join Date: Oct 2008
Originally Posted by K4GAP View Post
How can I limit a cms widget to a particular style?

The problem is I have only one light style and I design any widgets for the dark styles as there are more of them. I know I should stick with one style but I just can't choose .... they are all my babies
So what you are looking for is to prohibit the loading of a widget in a particular style?

--------------- Added 23 Jul 2014 at 14:33 ---------------

A simple method, if you just have a few widgets to modify, is to surround the widget with a style ID conditional.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Unfortunately, this method does not save you any resources on the server side.

Last edited by tbworld; 23 Jul 2014 at 21:34.
Reply With Quote
  #4  
Old 23 Jul 2014, 22:14
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Originally Posted by Zachery View Post
Why not just fix the widget in the style?
On my dark styles I have one widget that has light background. If I make it dark like the others then it will not look as I want it to on the light style. It's only one particular widget that can not have the background set as #transp so I want to exclude it from showing on the dark styles ..... make sense?
__________________

Reply With Quote
  #5  
Old 23 Jul 2014, 22:58
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
What type of widget is it?
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #6  
Old 24 Jul 2014, 00:19
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Originally Posted by ozzy47 View Post
What type of widget is it?
It's a Teamspeak monitor from GameTracker.
__________________

Reply With Quote
  #7  
Old 24 Jul 2014, 00:26
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
That's not quite what I ment, is it a PHP or a HTML type?
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #8  
Old 24 Jul 2014, 00:44
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Originally Posted by ozzy47 View Post
That's not quite what I ment, is it a PHP or a HTML type?

It's html.
__________________

Reply With Quote
  #9  
Old 24 Jul 2014, 00:53
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
 
Join Date: Sep 2008
Real name: Michael Miller Jr
Originally Posted by K4GAP View Post
On my dark styles I have one widget that has light background. If I make it dark like the others then it will not look as I want it to on the light style. It's only one particular widget that can not have the background set as #transp so I want to exclude it from showing on the dark styles ..... make sense?
Originally Posted by ozzy47 View Post
What type of widget is it?
Originally Posted by K4GAP View Post
It's a Teamspeak monitor from GameTracker.
Then edit the code

Here's one I edited to make the background dark:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Just change the FFFFFF and 000000 and others to the colors you want it to be erm wait nevermind because then its a global change... hmm... ok then we'll just use my method here to do this - If you will post your code like mine above AND what colors you want it to be in the dark style I'll whip something up for you... it might be that same method or it might simply call a new custom block template (one work around that comes to mind currently).
__________________
Daddy Does Dios and Figs!
https://www.linkedin.com/in/thelastsuperman

Search - Use the search feature to find similar issues/answers.
Information - Include screenshots, copy/pasted error codes, url etc.
Fixed - Please return to your thread/post and let us know how it was fixed!
Thanks - For participating! Click the "Like" on a post if someone helped you!
Reply With Quote
  #10  
Old 24 Jul 2014, 01:01
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Originally Posted by TheLastSuperman View Post
Then edit the code

Here's one I edited to make the background dark:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Just change the FFFFFF and 000000 and others to the colors you want it to be erm wait nevermind because then its a global change... hmm... ok then we'll just use my method here to do this - If you will post your code like mine above AND what colors you want it to be in the dark style I'll whip something up for you... it might be that same method or it might simply call a new custom block template (one work around that comes to mind currently).
This is the code that displays the way I want it to on the light style. I need it to match the dark styles when displayed there. But still be light on the light style".



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--------------- Added 24 Jul 2014 at 01:05 ---------------

While I'm thinking about it, if I could just exclude the widget from the dark styles that would be good too.
__________________

Reply With Quote
  #11  
Old 24 Jul 2014, 04:05
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Real name: Zachery Woods
Just assign a class to it, in the dark styles, have the class be a dark background, in the light styles, a light background, this is html/css 100.
__________________
Looking for ImpEx?
Reply With Quote
  #12  
Old 24 Jul 2014, 18:35
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
 
Join Date: Sep 2008
Real name: Michael Miller Jr
Cool

Originally Posted by K4GAP View Post
This is the code that displays the way I want it to on the light style. I need it to match the dark styles when displayed there. But still be light on the light style".



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--------------- Added 24 Jul 2014 at 01:05 ---------------

While I'm thinking about it, if I could just exclude the widget from the dark styles that would be good too.
K so we simply make a new template in your style:

Template name: vbcms_widget_static_page_ts

Template contents:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now in additional.css add:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

^ So no errors in css i.e. no missing definitions and in template manager best to insert somehting even if commented out using /* commented out */ etc.

Now create a new plugin:
AdminCP > Plugins & Products > Add New Plugin

Product: vBulletin
Hook location: parse_templates
Title: Hide Teamspeak Widget per style
Execution Order: 5

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

*Change 99 to the styleid # you want this to NOT show in and the css shown in the plugin code will kick in and hide it in styleid 99.

Now go back to the widgets in admincp, on your teamspeak widget change the template name being used to vbcms_widget_static_page_ts and save, now the widget should use this template and it will show in all styles except the one you excluded within the plugin.
__________________
Daddy Does Dios and Figs!
https://www.linkedin.com/in/thelastsuperman

Search - Use the search feature to find similar issues/answers.
Information - Include screenshots, copy/pasted error codes, url etc.
Fixed - Please return to your thread/post and let us know how it was fixed!
Thanks - For participating! Click the "Like" on a post if someone helped you!
Reply With Quote
  #13  
Old 24 Jul 2014, 23:50
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Thanks for all this ....
I did this 3 times and double checked your instructions.
This removes the Teamspeak widget in all styles. I made sure to change the 99 to the style id I did NOT want this widget to show on.

I'm in no hurry whatsoever so don't sweat it. It all looks as if it should work, but it just don't

BTW, I gave your status back in case you want to check it out for yourself. The info is in that pm I sent you the other day.
__________________

Reply With Quote
  #14  
Old 26 Jul 2014, 11:16
K4GAP K4GAP is offline
 
Join Date: Mar 2008
UPDATE:

I've come up with a happy median for both light and dark styles.
---------------------------------------------------------------

Been sitting here having a cup of coffee and thinking about .....................

I'm done with having multiple styles. I'm going with the Avenger style.
__________________


Last edited by K4GAP; 26 Jul 2014 at 11:55.
Reply With Quote
  #15  
Old 26 Jul 2014, 19:10
tbworld tbworld is offline
 
Join Date: Oct 2008
Yep, just one more thing to maintain.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 23:40.

Layout Options | Width: Wide Color: