I want to rename some of the path urls
for example :- http://localhost:4200/c/biotechnology/5/l/calendar
instead of calendar, i want to rename it as events .
http://localhost:4200/agenda
instead of agenda i want to change it to calendar
can you please advice me how to do it , can i do it through website admin panel.
or it needs to be done through code,
if it needs to done in backend , which is the exact file where can i change it ..
i am familiar with django , i am new to rails.
please help me out
Take a look at:
This guide covers the user-facing features of Rails routing.After reading this guide, you will know: How to interpret the code in config/routes.rb. How to construct your own routes, using either the preferred resourceful style or the match method....
These don’t look like core routes.
agenda, for example, does not exist on my instance - have you installed a plugin?
If so look at the plugin code, specifically in config/routes.rb (or potentially in plugin.rb)
I suggest spending some time to read and understand the structure of the source.
@merefield , No i didnt installed any plugin , in category settings if you enable agenda topic list then, in homepage a button will be enabled to view events from specific categories.
so i renamed that button , and now want to rename the url too , but i am unable to find how to do it.
That’s strange, because there’s no such route in base discourse.
https://raw.githubusercontent.com/discourse/discourse/main/config/routes.rb
… be my guest and search on “agenda”
I do not believe there’s such a section in Category settings out-of-the-box
I believe you must have a plugin installed, possibly this one:
end
::NewPostManager.add_handler(1) do |manager|
if manager.args['event'] && NewPostManager.post_needs_approval?(manager) && NewPostManager.is_first_post?(manager)
NewPostManager.add_plugin_payload_attribute('event') if NewPostManager.respond_to?(:add_plugin_payload_attribute)
end
nil
end
Discourse::Application.routes.prepend do
get "calendar.ics" => "list#calendar_ics", format: :ics, protocol: :webcal
get "calendar.rss" => "list#calendar_feed", format: :rss
get "agenda.rss" => "list#agenda_feed", format: :rss
%w{users u}.each do |root_path|
get "#{root_path}/:username/preferences/webcal-keys" => "users#preferences", constraints: { username: RouteFormat.username }
end
get "c/*category_slug_path_with_id/l/calendar.ics" => "list#calendar_ics", format: :ics, protocol: :webcal
get "c/*category_slug_path_with_id/l/calendar.rss" => "list#calendar_feed", format: :rss
my bad , you were right , its discourse events plugin i guess