Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Bootstrap 5 and Fontawesome 6 doesn't load in theme #5275

Open
rica-carv opened this issue Jun 13, 2024 · 7 comments
Open

[Bug]: Bootstrap 5 and Fontawesome 6 doesn't load in theme #5275

rica-carv opened this issue Jun 13, 2024 · 7 comments
Labels
type: bug A problem that should not be happening

Comments

@rica-carv
Copy link
Contributor

What e107 version are you using?

v2.3.3

Bug description

I'm trying to use BS5 and FA6 on a theme, with these code:

define("BOOTSTRAP", 5);
define("FONTAWESOME", 6);
e107::library('load', 'bootstrap');
e107::library('load', 'fontawesome');`

But when theme loads, icons and some text are not shown or bad rendered, and the bootsrtap libary that is loaded is BS3 and FA4....

What i'm doing wrong here?

How to reproduce

use


define("BOOTSTRAP", 5);
define("FONTAWESOME", 6);
e107::library('load', 'bootstrap');
e107::library('load', 'fontawesome');

inside theme.php, and use fa icons on the HTML

Expected behavior

I expected to render as usual, with BS3 and FA4

What browser(s) are you seeing the problem on?

Firefox

PHP Version

7.4

@rica-carv rica-carv added the type: bug A problem that should not be happening label Jun 13, 2024
@rica-carv
Copy link
Contributor Author

Well, ended up forcing it on the theme code, for now...
So now i have a theme with bootstrap 3 & 5 loaded and fontawesome 4 & 6 loaded....
What a mess... 😁 😅

@Jimmi08
Copy link
Contributor

Jimmi08 commented Jun 17, 2024

Because I don't know how (where) you are using those constants, you could look at a new way to load libraries via theme.xml

#4832

I am not saying that this works correctly (I have some issues with this topic too), but standard loading of libraries should be working.

@rica-carv
Copy link
Contributor Author

@Jimmi08 If you're talking about this:

          define("BOOTSTRAP", 5);
          define("FONTAWESOME", 6);
          e107::library('load', 'bootstrap');
          e107::library('load', 'fontawesome');

it also doesn't work. I even upgraded the theme to v2.3 standards (ie: with layouts and templates mixed....), but no go.

So i ended up loading them like this, the hard way:

          e107::css('url', 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css');
          e107::css('url', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/fontawesome.min.css');
          e107::js("footer", "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.min.js", 'jquery', 2);

@Jimmi08
Copy link
Contributor

Jimmi08 commented Jun 18, 2024

@rica-carv no, I am talking about theme.xml and library definition there. This shouldn't be used anymore:

          define("BOOTSTRAP", 5);
          define("FONTAWESOME", 6);
          e107::library('load', 'bootstrap');
          e107::library('load', 'fontawesome');

@rica-carv
Copy link
Contributor Author

@rica-carv no, I am talking about theme.xml and library definition there. This shouldn't be used anymore:

          define("BOOTSTRAP", 5);
          define("FONTAWESOME", 6);
          e107::library('load', 'bootstrap');
          e107::library('load', 'fontawesome');

@Jimmi08 Indeed, i learned the hard way you shouldn't mix both things.
For note, event this code only loads BS3, not 5....

So i aknowledge thath the xml way works, but only after a long strugle. Even without cache on, it keep creating cache, so i deleted it several times, no go. So i had to change theme severeal ways, with cache deleting by the midle, and finally it worked! It's weird to not have the xml read every time it's changed. It is only read at theme instalation, so it was a hard time. It should be a developer mode for preventing these issues....

Anyway, thanks for the help....

@Jimmi08
Copy link
Contributor

Jimmi08 commented Jun 22, 2024

@rica-carv I reported this many times. Or complained about this. The best way is to delete the cache folder manually. Yeah, I learned that hard way too. You will find that it is always cached (regardless your settings) and it always reads from cached file.

And be sure you have hash tag in your config file - new installations have it. And wait until your preferences will start to behave weird way. Long story.

@rica-carv
Copy link
Contributor Author

rica-carv commented Jun 22, 2024

Reopening, after all fontawesome 6 is not loaded, only bootstrap 5....

Furthermore, all icons are rendered as SVG tag's, not fa- classes tags.....

@rica-carv rica-carv reopened this Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A problem that should not be happening
Projects
None yet
Development

No branches or pull requests

2 participants