GamerBank
(GamerBank)
July 28, 2019, 9:18am
1
Hello guys,
Before come here to ask for help i’ve tried everything but without sucess until now
I’m trying to put category name after category image like the FiveM Forum (https://forum.fivem.net )
Already tried :
Edit category-title-link.hbs through docker image (docker -it imagename sh - \var\www\discourse\app\assets\javascripts\discourse\templates\components\category-title-link.hbs)
Using JQuery $( “category-text-title” ).insertBefore( “category-logo.aspect-image” ) on theme editor, i’ve discovered that dont work
Some css trics (flex, order, table)
I’ve see in fivem forum, they changed the divs order but is nothing on css or if is, im not good enough to find where.
Im the wordpress guy, hope someone more experienced to help, thanks in advice
2 Likes
fzngagan
(Faizaan Gagan)
July 28, 2019, 9:35am
2
According to my primary research, the template name seems to be categories-only.hbs
Try changing that. I haven’t tried it but I think it should be the template you are intending to change.
Secondly, I wouldn’t recommend changing it in discourse. A better way is to override the template.
2 Likes
GamerBank
(GamerBank)
July 28, 2019, 9:46am
3
fzngagan:
categories-only.hbs
The category-title-link.hbs contains exactly what im trying to change, but when i edit, theres no changes, do you know if needs to rebuild the app or something like that when edit hbs files?
{{category-title-before category=category}}
<a class="category-title-link" href={{category.url}}>
**<div class="category-text-title">**
{{#if category.read_restricted}}
{{d-icon 'lock'}}
{{/if}}
<span class="category-name">{{dir-span category.name}}</span>
</div>
{{#if category.uploaded_logo.url}}
{{cdn-img
src=category.uploaded_logo.url
**class="category-logo"**
width=category.uploaded_logo.width
height=category.uploaded_logo.height}}
{{/if}}
</a>
1 Like
fzngagan
(Faizaan Gagan)
July 28, 2019, 9:50am
4
If you edit ember code, you don’t need to restart the complete application, but make sure you hard reload the browser window so that you’re not seeing something the browser has cached.
2 Likes
GamerBank
(GamerBank)
July 28, 2019, 9:53am
5
After the changes, i’ve restart the docker container and restart the web server haha
I reloaded the page thousand of times and tried through incognito also
No changes
GamerBank
(GamerBank)
July 28, 2019, 9:56am
6
Just confirm for me please, im editing in the correct directory ?
\var\www\discorse\app\assets\javascripts\discourse\templates\components
the “templates” folder sounds that just a templates and not what is live, but im not understand that kind of programming, so is just a guessing
fzngagan
(Faizaan Gagan)
July 28, 2019, 9:58am
7
Try deleting the tmp
folder in the discourse root directory and then restart the server.
GamerBank
(GamerBank)
July 28, 2019, 10:13am
8
̶T̶h̶a̶t̶’̶s̶ ̶w̶h̶a̶t̶ ̶i̶m̶ ̶d̶o̶i̶n̶g̶
Why would you do that? This is a CSS change, through admin, customize.
4 Likes
GamerBank
(GamerBank)
July 28, 2019, 10:31am
11
Can you help me with this ? as i said i tried everything
Some css trics (flex, order, table) :x
pfaffman
(Jay Pfaffman)
July 28, 2019, 12:26pm
12
3 Likes
GamerBank
(GamerBank)
July 28, 2019, 12:30pm
13
Thank you Jay, but i’m not a developer, i know some things but as we can see, no enough to solve this, i really tried everything, including search for similiar topics here, no sucess
1 Like
GamerBank
(GamerBank)
July 29, 2019, 2:56am
14
Hey Jay, thank you so much, i’ve did
If someone is looking for that solution, just do this:
Go to Settings > Admin > Customize > Select active theme > Edit CSS/HTML
In </body>
field, put this code :
<script type="text/x-handlebars" data-template-name="components/category-title-link">
{{category-title-before category=category}}
<a class="category-title-link" href={{category.url}}>
{{#if category.uploaded_logo.url}}
{{cdn-img
src=category.uploaded_logo.url
class="category-logo"
width=category.uploaded_logo.width
height=category.uploaded_logo.height}}
{{/if}}
<div class="category-text-title">
{{#if category.read_restricted}}
{{d-icon 'lock'}}
{{/if}}
<span class="category-name">{{dir-span category.name}}</span>
</div>
</a>
</script>
And tada, its done
5 Likes
pfaffman
(Jay Pfaffman)
July 29, 2019, 3:40am
15
So you were a developer after all!
4 Likes
system
(system)
Closed
August 28, 2019, 3:40am
16
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.