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 日 09: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 个赞
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 日 09: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 个赞
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
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 日 09:58
7
Try deleting the tmp
folder in the discourse root directory and then restart the server.
̶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 日 02: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 日 03:40
15
So you were a developer after all!
4 个赞
system
(system)
关闭
2019 年8 月 28 日 03:40
16
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.