Wruczek / ts-website

A website for your TeamSpeak 3 server
https://ts.wruczek.tech
GNU General Public License v3.0
344 stars 80 forks source link

Font awesome in News Title? #228

Closed TheChaosToast closed 4 months ago

TheChaosToast commented 5 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

cataalin commented 5 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>
TheChaosToast commented 5 months ago

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

cataalin commented 5 months ago

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?

TheChaosToast commented 5 months ago

Yes, that's what I mean.

cataalin commented 5 months ago

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}
TheChaosToast commented 5 months ago

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

Wruczek commented 4 months ago

I've also updated TS-website to not escape news titles :)

TheChaosToast commented 4 months ago

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.

Wruczek commented 4 months ago

Only the first news entry is displayed?

TheChaosToast commented 4 months ago

Yes.

Wruczek commented 4 months ago

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?

TheChaosToast commented 4 months ago

sure,

I hope that's what you meant 😀 Screenshot_20240709_070800_Samsung Internet Screenshot_20240709_070918_Samsung Internet Screenshot_20240709_071001_Samsung Internet

Wruczek commented 4 months ago

I've tested the same title without issues. I assume that your news content has invalid HTML tags that breaks the site. image

TheChaosToast commented 4 months ago

I'm wondering where I changed the HTML tags? The only thing I changed was adding a meta description.

Wruczek commented 4 months ago

Can you dump the news table in DB and attach it here?

TheChaosToast commented 4 months ago

Here:

Pls delete this file after Download here

Wruczek commented 4 months ago

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

image

TheChaosToast commented 4 months ago

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 :(

TheChaosToast commented 4 months ago

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