techAPJ
(Arpit Jalan)
December 1, 2015, 9:36pm
1
Deprecated: There is now a theme-component that provides the same feature: Topic Footer Buttons
Summary : This plugin adds a custom button at the bottom of a topic, visible to everyone (who is logged in).
GitHub : https://github.com/techapj/discourse-custom-topic-button
Install : Follow the plugin installation guide .
Features
Configuration
From Admin > Site Settings > Plugin, modify
custom_topic_button_url
custom_topic_button_title
custom_topic_button_label
Note: For button to be visible only to staff or members of a specific group, see:
CHANGELOG
TODO
20 Likes
danielabc
(Daniela)
January 28, 2023, 6:00pm
5
when I click on the button it opens a link on another page, how do I click on the button and it opens on the same page?
1 Like
I’m not sure, but I believe there are a couple of official theme components that are the up-to-date method of acheiving this. Topic Footer Buttons
Do they behave in a similar way?
danielabc
(Daniela)
January 30, 2023, 6:58pm
7
I installed them, but both open the link in another window, is there any way for it to open in the same window?
Hmmm. If I’m reading it right, I think it’s part of the theme component code that it opens in a new window:
.replace("<TOPIC_TITLE>", this.topic.title)
.replace("<TOPIC_SLUG>", this.topic.slug);
}
if (currentUser) {
url = url
.replace("<USER_ID>", currentUser.id)
.replace("<USERNAME>", currentUser.username)
}
window.open(url, "_blank");
},
dropdown() {
return this.site.mobileView;
},
classNames: ["discourse-custom-topic-button"],
dependentKeys: ["topic.id", "topic.title", "topic.slug"],
displayed() {
return settings.custom_topic_button_enabled;
}
});
(and the plugins too I think)
discourse-custom-topic-button/custom-public-button.js.es6 at c4a91727c0322f0c59bc09af7fbcb076b5676de4 · techAPJ/discourse-custom-topic-button · GitHub
It does not seem that there’s currently a way through the UI to change that. It may be possible to amend that behaviour with a bit of custom work, but I’m afraid that’s not my forte.
1 Like
Canapin
(Coin-coin le Canapin)
January 30, 2023, 10:48pm
9
Hi koliwi, I’ll try to have a look at the theme component to add this feature this week.
3 Likes
danielabc
(Daniela)
January 31, 2023, 3:27am
10
Is this plugin yours? Congratulations for the work, I really liked it! If you can open it in the same window it will be even better! Thanks!
Canapin
(Coin-coin le Canapin)
January 31, 2023, 11:44am
11
It’s not mine, but I can have a look at it nonetheless. I’ll let you know
1 Like