Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Bootstrap css is not loaded

Bootstrap css is not loaded 24 Sep 2013 11:24 #11179

  • Tomaselli
  • Tomaselli's Avatar
  • Online
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
Everybody (included me) are assuming boostrap is loaded by default on a Joomla 3.x
that's not totally true.

it's loaded only the JS library, not the CSS.
I had to modify the file ROOT\administrator\components\com_mycomponent\dom\framework\bootstrap\core.php to have the bootstrap css fully loaded.

here the original file:
	function buildCss()
	{
		//Bootstrap should not be used
		if (!$this->useFramework('bootstrap'))
			return;

		//Bootstrap is already in the core since Joomla 3.0. And already loaded.
		if (!$this->jVersion('3.0'))
		{		
			$this->attachCss[] = 'bootstrap.min.css';
			$this->attachCss[] = 'bootstrap-responsive.min.css';
			$this->attachCss[] = 'bootstrap-extended.css';
		}
		
		//Some fixes and compatibility
		$this->attachCss[] = 'bootstrap-legacy.css';
	}

and here the modification:
	function buildCss()
	{
		//Bootstrap should not be used
		if (!$this->useFramework('bootstrap'))
			return;

		$this->attachCss[] = 'bootstrap.min.css';
		$this->attachCss[] = 'bootstrap-responsive.min.css';
		$this->attachCss[] = 'bootstrap-extended.css';
		
		//Some fixes and compatibility
		$this->attachCss[] = 'bootstrap-legacy.css';
	}
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Bootstrap css is not loaded 29 Sep 2013 23:55 #11248

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Fixed
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: Tomaselli
Time to create page: 0.122 seconds

Get Started