Wruczek / ts-website

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

Font awesome in News Title? #228

Open TheChaosToast opened 3 days ago

TheChaosToast commented 3 days 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 3 days 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 3 days 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 3 days 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 2 days ago

Yes, that's what I mean.

cataalin commented 2 days 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 2 days 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