GamerBank
(GamerBank)
2019 年 7 月 28 日午前 9:18
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
fzngagan
(Faizaan Gagan)
2019 年 7 月 28 日午前 9:35
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
GamerBank
(GamerBank)
2019 年 7 月 28 日午前 9:46
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
fzngagan
(Faizaan Gagan)
2019 年 7 月 28 日午前 9:50
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
GamerBank
(GamerBank)
2019 年 7 月 28 日午前 9:53
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)
2019 年 7 月 28 日午前 9:56
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)
2019 年 7 月 28 日午前 9:58
7
Try deleting the tmp
folder in the discourse root directory and then restart the server.
GamerBank
(GamerBank)
2019 年 7 月 28 日午前 10:13
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
GamerBank
(GamerBank)
2019 年 7 月 28 日午前 10:31
11
Can you help me with this ? as i said i tried everything
Some css trics (flex, order, table) :x
pfaffman
(Jay Pfaffman)
2019 年 7 月 28 日午後 12:26
12
「いいね!」 3
GamerBank
(GamerBank)
2019 年 7 月 28 日午後 12:30
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
GamerBank
(GamerBank)
2019 年 7 月 29 日午前 2:56
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
pfaffman
(Jay Pfaffman)
2019 年 7 月 29 日午前 3:40
15
So you were a developer after all!
「いいね!」 4
system
(system)
クローズされました:
2019 年 8 月 28 日午前 3:40
16
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.