Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBulletin Mobile Style - CSS Tips & Tricks
TheLastSuperman's Avatar
TheLastSuperman
Join Date: Sep 2008
Posts: 5,844

Hey vb.org members and coders! Not much to say except I have a beautiful wife, three fantastic kids

North Carolina
Show Printable Version Email this Page Subscription
TheLastSuperman TheLastSuperman is offline 03-08-2011, 10:00 PM

With the release of vBulletin 4.1.2, we have available a Mobile Style! You can read more about that here:
http://www.vbulletin.com/forum/conte...t-Mobile-Style

Currently it's only compatible with the forum, meaning that no matter if you own the vBulletin Suite or vBulletin Forum Classic you can only use this for the forum at the moment however CMS and Blog versions are in development.

Now I've seen some posts already asking how to customize?

Example:
https://vborg.vbsupport.ru/showthread.php?t=258994

Now what have I figured out?
  • The mobile style uses it's own css file, jquery.mobile-1.0a2.min.css
  • The .css file is located in: clientscript/jquery
  • Example path to file: clientscript/jquery/jquery.mobile-1.0a2.min.css
  • The CSS file reads left to right and it's all crammed together, making it hard to edit for novices.

What else Michael? - Well simple, I've found out there's no additional.css included by default which disappointed me slightly although do you truly need it? I say if you plan on customizing then yes if not then no worries! Now we can go about making a few changes to sort all this out but there's several ways ready to see them?


Method 1

Edit Mobile file accordingly or simply add in additional.css so it's parsed. You can add it in very quickly by editing the template headinclude

Find:

Code:
<vb:if condition="$vboptions['storecssasfile']">
	{vb:cssfile main-rollup.css}
        {vb:raw template_hook.custom_css_links}
<vb:else />
	{vb:cssfile bbcode.css,editor.css,popupmenu.css,reset-fonts.css,vbulletin.css,vbulletin-chrome.css,vbulletin-formcontrols.css{vb:raw template_hook.custom_css_list}}
</vb:if>

Add under:

Code:
{vb:cssfile additional.css}
Save the template, now add in your custom CSS to additional.css, make the necessary changes to your other templates within the mobile style saving those templates as well now refresh to see your changes! Your additional.css now works in the mobile style and upon your next upgrade it will not be overwritten so if you carefully add in custom css or css to overwrite the default css in additional.css you'll never lose those changes!

Method 2

Overwrite the mobile css via a plugin! Check this modification thread:
https://vborg.vbsupport.ru/showthread.php?p=2171633

Download and install - now instead of editing the mobile css file you simply edit your CSS Templates, scroll down and find mobilestyle.css and double-click to edit, make changes to that css as it's called last and after the file is called! This template should not overwrite with an upgrade either so no worries there.

Optional:
Your calling a css template... let's not make it overwrite the file being called instead let's remove it properly. Open template headinclude

Find:

Code:
<link rel="stylesheet" href="clientscript/jquery/jquery.mobile-1.0a2.min.css?v={vb:raw vboptions.simpleversion}" />
Replace with:

Code:
<vb:comment><link rel="stylesheet" href="clientscript/jquery/jquery.mobile-1.0a2.min.css?v={vb:raw vboptions.simpleversion}" /></vb:comment>
Save the template, if you installed the modification then your css for the mobile style is now in mobilestyle.css and your no longer overwriting the other file which is the correct way of doing things.

Customize your heart out and enjoy!

Preferred CSS Layout ?

Personally, I hate it when CSS is typed out as it is in the file, it's all crammed together and hard to read and edit imo! So I've taken the liberty and cleaned it up quite a bit, check it out below and remember it's an exact copy only in a more traditional style.

Example:
Code:
.ui-bar-a {
border:1px solid #2A2A2A;
background:#111;
color:#fff;
font-weight:bold;
text-shadow:0 -1px 1px #000;
background-image:-moz-linear-gradient(top,#3c3c3c,#111);
background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3c3c3c),color-stop(1,#111));
-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#3c3c3c',EndColorStr='#111111')";
}
*If you notice any issues with the CSS attached please report promptly .
**I also added in a outline near the end so the logo would not do the dotted border when clicked upon etc.
*** Uploaded as attachment due to code being too long to post, rename and remove .php leaving only .css to view .

https://vborg.vbsupport.ru/attachmen...1&d=1299713796
Attached Files
File Type: php mobilestyle.css.php (44.5 KB, 196 views)
Reply With Quote
  #2  
Old 03-10-2011, 01:16 AM
ErnestO999 ErnestO999 is offline
 
Join Date: Apr 2010
Location: San Francisco, CA
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks TheLastSuperman for the tips I Use On My Style Mobile for my forum
Blessing for you Life man♥

Greetings from Venezuela
Reply With Quote
  #3  
Old 03-10-2011, 06:18 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ErnestO999 View Post
Thanks TheLastSuperman for the tips I Use On My Style Mobile for my forum
Blessing for you Life man♥

Greetings from Venezuela
Awesome! Glad it was helpful
Reply With Quote
  #4  
Old 02-10-2012, 04:29 PM
chrisngrod's Avatar
chrisngrod chrisngrod is offline
 
Join Date: Oct 2010
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alright... You da man... DaSuperman.

Thanks a lot!
Reply With Quote
  #5  
Old 03-07-2012, 08:56 PM
Dragaon Dragaon is offline
 
Join Date: Feb 2010
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found a easy and painless way to fix the css mess, hopefully it will help anyone wating to customize it.
I downloaded a fresh new properly formatted http://code.jquery.com/mobile/1.0.1/...bile-1.0.1.css and placed it in the clientscript/jquery folder and then edited the file as needed, (all i wanted was to change the colors in the header bar ui-bar-b) it worked perfectly and is easy to read and edit at will now.
Reply With Quote
  #6  
Old 02-20-2013, 07:59 PM
Jeromedia603 Jeromedia603 is offline
 
Join Date: May 2008
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dragaon View Post
I found a easy and painless way to fix the css mess, hopefully it will help anyone wating to customize it.
I downloaded a fresh new properly formatted http://code.jquery.com/mobile/1.0.1/...bile-1.0.1.css and placed it in the clientscript/jquery folder and then edited the file as needed, (all i wanted was to change the colors in the header bar ui-bar-b) it worked perfectly and is easy to read and edit at will now.
What do you name the file then? Does it stay the actual name in the link?
Reply With Quote
  #7  
Old 02-25-2013, 06:18 PM
Dorgham's Avatar
Dorgham Dorgham is offline
 
Join Date: May 2012
Location: Egypt
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm going to install vBulletin Mobile Style now
And certainly I will face some problems
And I will come back to you again to inquire for help
Thank you TheLastSuperman
Reply With Quote
  #8  
Old 04-21-2013, 03:01 PM
furnival furnival is offline
 
Join Date: Mar 2008
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On VB 4.2 the link in the mobile template seems to be like this
Code:
 <link rel="stylesheet" href="clientscript/jquery/jquery.mobile-1.0.min.css?v={vb:raw vboptions.simpleversion}" />
I don't know why there's all these extra versions in the clientscript directory and I have no idea which one is best so I guess I will just edit a copy of the 1.0.min.css file. However that means that the nicely-spaced version of the code provided above is no longer useful.

--------------- Added [DATE]1366562513[/DATE] at [TIME]1366562513[/TIME] ---------------

What template does this mod actually create? It doesn't seem to create anything in VB4.2.1 , I couldn't find a template after installing it and searching for "mobiletemplate" anyway. This mod should be updated or consigned to the graveyard.
Reply With Quote
  #9  
Old 04-19-2014, 12:21 AM
furnival furnival is offline
 
Join Date: Mar 2008
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So pleased to be stuck with this mobile template (for which I paid good money and was promised updates) and having to heavily customise the old JQuery code whilst JQuery releases new and better code. Anyway... Does anyone have any idea how I can add thread sorting options to Forumhome in this thing?
Reply With Quote
  #10  
Old 04-19-2014, 05:03 AM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by furnival View Post
On VB 4.2 the link in the mobile template seems to be like this
Code:
 <link rel="stylesheet" href="clientscript/jquery/jquery.mobile-1.0.min.css?v={vb:raw vboptions.simpleversion}" />
I don't know why there's all these extra versions in the clientscript directory and I have no idea which one is best so I guess I will just edit a copy of the 1.0.min.css file. However that means that the nicely-spaced version of the code provided above is no longer useful.

--------------- Added [DATE]1366562513[/DATE] at [TIME]1366562513[/TIME] ---------------

What template does this mod actually create? It doesn't seem to create anything in VB4.2.1 , I couldn't find a template after installing it and searching for "mobiletemplate" anyway. This mod should be updated or consigned to the graveyard.
It doesn't create a template, this is an article not a mod. See Method #2 above for a link to a mod that creates a template however the css for that is outdated and would need to be updated before use and no I have no plans to do that anytime soon unless pigs decide to fly in my head one afternoon (I'm sure they weill I run off on muddy tangents all the time lol).
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 08:35 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05581 seconds
  • Memory Usage 2,326KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete