Bootstrap [responsive, mobile-ready]

Forum
Last Post
Threads / Messages
Kyttias, is there a way to create Subfolders in the Theme "dropdown?" So that we can have say...

themes
-->Default themes
----->The list of default bootstrap themes
-->Theme list 2
------>Themes within list 2.

And so on?
 
A Google search says yes, since it pointed me to this: http://bootsnipp.com/snippets/featured/multi-level-dropdown-menu-bs3

The theme changer dropdown is dynamically appended to the end of the navigation menu with javascript in themeswitcher-kyt.js. You would need to add the css from the link above to your stylesheet and then manually modify line 12, which won't be easy, for three reasons:

1) It has to stay on one line or the read out of it will break.
2) Slashes in closing tags must be backslashed.
3) Quotes must be backslashed.

Then you need to follow the instructions in the commented out are half way through the file. Basically, the links to themes are not true links, since javascript needs to be used to swap out the css files. Add a custom class to the theme you added to the list, then copy and paste out the code provided in the commented section of the file to below it so it's no longer in the comment zone, and make sure the class name from the list and the snippet of code that will swap out the css when clicked are the same.

-

disclaimer: This is really something only meant for developers who know what they're doing and the theme changer should honestly be removed from any active, published website. If you just want to see what a different set of colors look like, I really recommend just changing what file you're linking to in your theme's header.
 
how to solve this error?
Clipboard01.png
 
Make sure you follow all the installation steps carefully. It's very easy to accidentally tell the AdminCP to overwrite the theme files with blank contents. I think that may be what's happening. Otherwise, I think the url looks wrong. I don't believe 'index' should be in there??? That, and, this is important: Make sure the theme name is the same everywhere. Capitalization is important. I suggest NOT capitalizing any of it. Not the folder name, not the theme name, not during installing, not at all. That could also be the cause of the problem. It might be looking for "Bootstrap" but you don't have "Bootstrap" you have "bootstrap".
 
Last edited:
This is wonderful! Your tutorial explains things very well! Bravo!
 
THANK YOU!

Thank you so much for taking the time to offer this. It works perfectly!
 
This is amazing, I am loving it! Thank you so very very much!!

I am having a little trouble with my custom theme made on StyleBootstrap.info, though.... I'm wondering if I messed up somewhere. It shows the link in the theme changer, but when I click my custom theme, all the styling goes poof.

Here is my edited themeswitcher kyt:

/* =============== Need help with this? *
You can contact me (Kyttias) on AIM, GoogleTalk, Skype, Tumblr,
DeviantART or @gmail.com. I prefer chatting over AIM, and email
is your best bet if I've not been recently active on Tumblr or
DeviantART. I can use GoogleTalk or Skype if it is of preference
to you. */



/* =============== Theme Changer */
/* Add theme drop down to top navigation. */
$(".navbar-nav").append("<li class="dropdown" id="theme-dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-cogs icon-large"><\/i> Theme<\/a> <ul class="dropdown-menu"> <li><a href="#" class="change-style-menu-item" rel="wubbie"><i class="icon-fixed-width icon-pencil"><\/i> Wubbie Forest  <\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="amelia"><i class="icon-fixed-width icon-pencil"><\/i> Amelia  <\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="cerulean"><i class="icon-fixed-width icon-pencil"><\/i> Cerulean  <\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="cosmo"><i class="icon-fixed-width icon-pencil"><\/i> Cosmo  <\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="cyborg"><i class="icon-fixed-width icon-pencil"><\/i> Cyborg  <\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="flatly"><i class="icon-fixed-width icon-pencil"><\/i> Flatly    <\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="journal"><i class="icon-fixed-width icon-pencil"><\/i> Journal<\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="readable"><i class="icon-fixed-width icon-pencil"><\/i> Readable<\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="simplex"><i class="icon-fixed-width icon-pencil"><\/i> Simplex  <\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="slate"><i class="icon-fixed-width icon-pencil"><\/i> Slate    <\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="spacelab"><i class="icon-fixed-width icon-pencil"><\/i> Spacelab<\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="united"><i class="icon-fixed-width icon-pencil"><\/i> United      <\/a><\/li> <li><a href="#" class="change-style-menu-item" rel="yeti"><i class="icon-fixed-width icon-pencil"><\/i> Yeti  <\/a><\/li> <li><a href="#" class="change-style-menu-back"><i class="icon-fixed-width icon-pencil"><\/i> Blank (Default)  <\/a><\/li> <\/ul><\/li>");

/* Change the theme by clicking on it. */
$('body').on('click', '.change-style-menu-item', function() { /*standard themes*/
var theme_name = $(this).attr('rel') + "/";
var theme = "//netdna.bootstrapcdn.com/bootswatch/3.0.3/" + theme_name + "bootstrap.min.css";
set_theme(theme);
});
$('body').on('click', '.change-style-menu-back', function() { /*blank theme*/
var theme = "//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css";
set_theme(theme);
});

/* ADD CUSTOM THEME: UNCOMMENT TO USE */
/*Make a custom theme at StyleBootstrap.info!
You'll need to find the list of themes above, copy one, and it must be pasted inline with the rest.
Give it a custom class, and then change that class below!
Then all you have to do is provide a direct path to your custom css file. */

$('body').on('click', '.wubbie', function() {
var theme = "http://wubbiepets.com/templates/Bootstrap/wubbie.css";
set_theme(theme);
});



/* Does their browser support saving the theme to local storage? */
function supports_html5_storage() {
try { return 'localStorage' in window && window['localStorage'] !== null; }
catch (e) { return false; }
}
var supports_storage = supports_html5_storage();

/* Remember user theme! */
function set_theme(theme) {
$('link[title="bootstrap"]').attr('href', theme);
if (supports_storage) { localStorage.theme = theme; }
}

/* On load, grab user's preferred theme from local storage. */
if (supports_storage) {
var theme = localStorage.theme;
if (theme) { set_theme(theme); }
}
else { /* Don't annoy user with options that don't persist. */
$('#theme-dropdown').hide();
}
/* End Theme Changer =============== */

And this is my header:

<!-- / / / / / / / / / / Need help with this template?
You can contact me (Kyttias) on AIM, GoogleTalk, Skype, Tumblr,
DeviantART or @gmail.com. I prefer chatting over AIM, and email
is your best bet if I've not been recently active on Tumblr or
DeviantART. I can use GoogleTalk or Skype if it is of preference
to you. -->

<!DOCTYPE html>
<html lang="en"><head>
<script src="{$home}{$temp}{$theme}/flickerfix-kyt.js""></script>
<title>{$browser_title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- / / / / / / / / / FULL CSS RESET -->
<link href="//cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css" rel="stylesheet">
<!-- / / / / / / / / / BOOTSTRAP 3 -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" title="bootstrap">
<!--
If you picked out a theme from BootSwatch, find it on BootstrapCDN.com and replace the link above.
If using themeswitcher.js, make sure the line above always includes title="bootstrap" as an attribute!
If you make a custom Bootstrap theme at StyleBootstrap.info, observe the lines below as a hint on how to include it.
Replace the href above if you prefer to use a custom theme with the theme changer, or, delete the line above,
and include in the same manner as the stylesheet is below. {$home}{$temp}{$theme} is this template folder!
-->
{$header->loadFavicon("{$home}favicon.ico")}
{$header->loadStyle("{$home}{$temp}{$theme}/style-kyt.css")}
{$header->loadAdditionalStyle("{$home}{$temp}{$theme}/wubbie.css")}
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>

Those are the only two files I edited... it's pretty late and my brain is mush so I'm probably missing something ^^;;

Also, I've noticed that with the built-in styles, it always loads the page without the style for a split second before loading the style. Is there any way to fix that?
 
Last edited:
Do not use the theme switcher for a live site.

Do not use the theme switcher on a live site.

Do not use the theme switcher on a live site.

It exists merely as a tool to preview different Bootstrap themes on your website. I shouldn't have to explain why this is a bad idea. Things shouldn't flicker if you don't use it. Things flicker because it loads the default css first, then whatever one is selected on the switcher. On every. Single. Page. Load. Don't use it, it's for preview decisions only!

If you were wanting to use a different Bootstrap color theme, then you'll want to change the link to the Bootstrap css file in header.tpl. It's this line:
Code:
 <!-- / / / / / / / / / BOOTSTRAP 3 -->
 <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" title="bootstrap">

And it can be changed to use a different color theme. So once you've chosen a color theme from the theme switcher that you like, I 100% recommend deleting the theme switcher file entirely (themeswitcher-kyt.js), removing the line for it at the bottom of template.tpl, and replacing the Bootstrap css you are linking to in the header.tpl.

Either change it to file hosted on a CDN (this link should have all the ones from the theme switcher and maybe more):
Code:
 <!-- / / / / / / / / / BOOTSTRAP 3 USING "SANDSTONE" -->
 <link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/sandstone/bootstrap.min.css" rel="stylesheet" title="bootstrap">

Or to your own in the theme folder (you can build one here, but I think you got that covered):
Code:
 <!-- / / / / / / / / / BOOTSTRAP 3 USING YOUR OWN BOOTSTRAP-->
 <link href="{$home}{$temp}{$theme}/NAME_OF_YOUR_BOOTSTRAP.css" rel="stylesheet" title="bootstrap">

If you want to edit anything else, such as the TEMPLATE itself, which is in style_kyt.css, then that's beyond the scope of my tech support, so make a separate css file for it, use it last in the header, and leave everything else intact.

It should look like this:
PHP:
{$header->loadStyle("{$home}{$temp}{$theme}/style-kyt.css")}
{$header->loadAdditionalStyle()}
<link href="{$home}{$temp}{$theme}/YOUR_CUSTOM_NON_BOOTSTRAP_CSS.css" rel="stylesheet">

Or this:
PHP:
{$header->loadStyle("{$home}{$temp}{$theme}/style-kyt.css")}
{$header->loadAdditionalStyle()}
<style> /* YOUR CSS HERE IF IT'S SMALL */ </style>

Please note that {$header->loadAdditionalStyle()} is empty. It is empty in ALL of the templates provided with Mysidia. I don't know what it does. Maybe it works like you think it does, maybe it doesn't, but you absolutely don't have to put anything in it. I recommend not.

And, in the end, I can only say this: DON'T USE THE THEME SWITCHER ON A LIVE SITE. Mostly because of the flickering issue.

--

To be honest, the real reason I'm dropping support for the theme switcher is because the directions just aren't clear for adding custom code. I don't think you're doing anything particularly wrong, just that the code is being told "if the user clicks on an element with a class of wubbie..." but none of the html you added has a class of wubbie. None of the examples have a class name that corresponds with their theme name, but then again, they didn't need one when I made the theme switcher.

I'm not active enough to pinpoint the exact problem, and instead I provided alternatives that don't use the theme switcher. Maybe this could work, but maybe it just won't:

Code:
 <li><a href="#" class="wubbie" rel="wubbie"><i class="icon-fixed-width icon-pencil"><\/i> Wubbie Forest  <\/a><\/li>
 
Last edited:
This one??? https://sta.sh/0ny9dwq3t9o It is for me????

edit: Stash is hosted through deviantArt and, tbh, their service has been buggy all month. I think they're having hosting issues. My best answer right now is to try later, unfortunately.
 
Last edited:
Will this mod work with 1.3.6 (latest release)?

I just tested it on a fresh install and it does work, however at first the screen was blank and nothing loaded so you need to open header.tpl and comment out:

HTML:
<script src="{$home}{$temp}{$theme}/flickerfix-kyt.js"></script>

That was the culprit. Bear in mind I have no idea if that's essential in some way or why it broke things so be prepared to enter the database to manually swap the theme back if something is broken, haha. Also I haven't really been to many pages other than index so things might not be perfect I guess. But it works from what I've seen lol.

2021-12-25 06_03_25-Settings.png
 
How do I add a custom cursor for the whole site to the 1.3.4 version?
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,118
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top