Bcat
(Bcat)
23 أبريل 2021، 11:18ص
1
This my code:
<% if ( @topic_view.topic.tags.length > 0 and @topic_view.topic.tags.include? "abcxyza" ) %>
SOME THING
<% else %>
Full code: here
And is it wrong to make the site inaccessible?
Can you give me the correct code to check that article tags have an id tag named “abcxyz”?
إعجاب واحد (1)
Out of interest why are you using an erb file and not an hbs file?
Normally you would use an hbs template within a connector.
إعجاب واحد (1)
Bcat
(Bcat)
23 أبريل 2021، 1:38م
3
I am not good at coding so I have followed another plugin with the function that may interfere with the connectors.
So if you write it on hbs file will things be easier?
I could be wrong but connectors are ember components so you actually need to change your directory structure here to match a discourse ember structure as well. I would look at existing official or pavilion plugins for examples.
Then again if you are stuck on server side rendering because of ‘amp’ you may need a different approach closer to what you are already doing. However I’m not sure connectors work in that scenario? - I’m not your best advisor here and will open that up to the house.
Connectors seem to also be supported for server side rendered erb files.
إعجاب واحد (1)
Which plugin was this out of interest?
Bcat
(Bcat)
23 أبريل 2021، 1:51م
6
A Discourse plugin that lets you use topics to rate things!
Features
Rate topics by a star rating system in the composer.
Enable different rating types on a per-category or per-tag basis.
Toggle rating count and average rating per rating type.
Toggle visibility of ratings, counts and averages based on user roles.
Bulk actions including rating type migration
[screenshot]
Get the code
Report a bug
Lost?
Not sure how to install a plugin? Follow the steps here .
Mak…
is: discourse-ratings/app/views/connectors/topic_header/aggregate_rating.html.erb at main · paviliondev/discourse-ratings · GitHub
I just see how to insert an html clip into a topic and it still shows when viewing source. Previously I wanted to insert on the engine
Thanks. I stand corrected. Looks like you can.
إعجاب واحد (1)
Bcat
(Bcat)
23 أبريل 2021، 1:54م
8
I’m trying to see what it is
<%= @topic_view.topic.inspect %>
<%= @topic_view.topic.tags.inspect %>
<%= @topic_view.topic.tags[0].inspect %>
Bcat
(Bcat)
23 أبريل 2021، 2:01م
9
Thank you.
I don’t know, testing the code and running it takes a long time … 90% of the time is waiting
إعجاب واحد (1)
You cannot run it locally to test it? Always good to test something locally first before deploying. As you say, time.
إعجاب واحد (1)
Bcat
(Bcat)
23 أبريل 2021، 2:05م
11
Everything is done and I find myself stupid: D Instead of using $value[“key”] I use $value.key :))
You cannot run it locally to test it? => I created a new server and tested it.
Thank you very much, good day. @merefield
إعجابَين (2)