Closed TheChaosToast closed 4 months ago
Hello everyone,
is there a way to insert font awesome into the news title? So in the headline? I've currently solved it using unicode, but it would be nice if you could do it with font awesome.
if so, how?
many thanks <3
Src/private/templates/index.latte
You already have font awesome loaded, you just need to add it, you have an example by opening the index.latte on line 7, add it on line 28 for example and leave it to your liking.
<i class="far fa-newspaper"></i>
Hello Catalin,
I meant it differently: When I add new news entries to the database, I can enter the title and the content. And I would like to use Font Awesome for the title, unfortunately that doesn't work, or my approach is wrong. Otherwise I'll stick with Unicode if that's too complicated.
<3
Hello Catalin,
I meant it differently: When I add new news entries to the database, I can enter the title and the content. And I would like to use Font Awesome for the title, unfortunately that doesn't work, or my approach is wrong. Otherwise I'll stick with Unicode if that's too complicated.
<3
Do you mean using font awesome as if it were icons in the text?
Yes, that's what I mean.
Yes, that's what I mean.
If you write the news manually in the db, put the icon in the db in this way, for example:
<i class="fas fa-star"></i> test tittle for news
and then to show it both in the title and in the news that shows the icon, use the noescape filter, for example like this in index.latte:
{$news["title"]}
Change to:
{$news["title"]|noescape}
If you write the news manually in the db, put the icon in the db in this way, for example:
<i class="fas fa-star"></i> test tittle for news
and then to show it both in the title and in the news that shows the icon, use the noescape filter, for example like this in index.latte:
{$news["title"]}
Change to:
{$news["title"]|noescape}
hello cataalin,
that's exactly what I wanted. thank you so much <3
I've also updated TS-website to not escape news titles :)
I have to report again:
I have now saved a second and third news entry in my database. The first is displayed with an icon, the second and third are no longer displayed.
At first I thought I had entered it incorrectly, but it seems to be correct.
Only the first news entry is displayed?
Yes.
Probably the HTML used in the title is invalid. Can you screenshot or dump the news table contents with titles of all news fully visible?
sure,
I hope that's what you meant 😀
I've tested the same title without issues. I assume that your news content has invalid HTML tags that breaks the site.
I'm wondering where I changed the HTML tags? The only thing I changed was adding a meta description.
Can you dump the news table in DB and attach it here?
Here:
Pls delete this file after Download here
Works for me. Maybe try undoing your modifications by replacing your files with the ones from the repo - for example, replace index.latte with the original file
damn, unfortunately it's not the index.latte that's the problem. I replaced the file and deleted the cache. Unfortunately, the awesome font isn't displayed in the test :(
hello wruczek,
it's been resolved. for some reason it's working again now. I restarted the web server this morning, maybe that was the problem.
thank you for your help and support
Hello everyone,
is there a way to insert font awesome into the news title? So in the headline? I've currently solved it using unicode, but it would be nice if you could do it with font awesome.
if so, how?
many thanks <3