Skip to main content

Accessing Router and Route Objects

Introduction

For plugin developers working with Codex, understanding how to interact with the router and route objects is crucial for creating dynamic, responsive components. In Vue.js, these objects are accessed via this.$router and this.$route respectively. This guide will explain their usage and provide a comprehensive list of the current routes in Codex.

Pre-requisites

Before continuing with this tutorial, please make sure you have read our plugins Quick Start guide and Create your first plugin tutorial, which goes through the setup of the first plugin used during this tutorial.

Accessing $router and $route:

  • this.$router: This is the Vue Router instance. You can use it to programmatically navigate to different pages, check the current route, or modify routing behavior.
  • this.$route: This object represents the current active route. It provides access to the route's path, query parameters, route parameters, and more.

These objects are essential for creating components that respond to routing changes and interact with Codex's navigation.

For more details on the Vue Router, please refer to the official documentation.

Current Routes in Codex

Below is a table of the current routes available in Codex, categorized into Organization and Site routes. Each entry includes the route's path, name, and the parameters it accepts.

info

When navigating within the organization context, the orgName parameter is automatically populated based on the current organizational scope. This allows for seamless transitions between routes under the same organization without the need to explicitly specify the orgName each time. This feature is particularly useful when accessing routes directly from the organization dashboard, ensuring a consistent and streamlined navigation experience.

Similarly, when operating within a specific site, the siteName parameter is intelligently filled by Vue Router, reflecting the current site context. This eliminates the need for manual input of the siteName when moving between routes that are part of the same site. This automatic parameter handling is especially advantageous when navigating from the site dashboard, enhancing the user's navigation flow and maintaining the context of the site being managed.

Organization Routes

PathNameParameters
/:orgName/user-settings/profileuser-profileorgName
/:orgName/user-settings/notificationsuser-notificationsorgName
/:orgName/user-settings/authoruser-authororgName
/:orgName/authorsauthorsorgName
/:orgName/authors/:idauthors-editorgName, id
/:orgName/dashboard-usersdashboard-usersorgName
/:orgName/dashboard-users/:idedit-siteUsersorgName, id
/:orgName/homehomeorgName
/:orgName/sitessitesorgName
/:orgName/notifications/all-notificationsorgName
/:orgName/api-keysapi-keysorgName
/:orgName/labelslabelsorgName
/:orgName/teamsteamsorgName
/:orgName/teams/:idteams-editorgName, id
/:orgName/modelsmodelsorgName
/:orgName/models/:idmodels-editorgName, id
/:orgName/pluginspluginsorgName
/:orgName/plugins/:idplugins-editorgName, id
/:orgName/webhookswebhooksorgName
/:orgName/webhooks/:idwebhooks-editorgName, id
/:orgName/presetspresetsorgName
/:orgName/assetsassetsorgName
/:orgName/all-integrationsall-integrationsorgName
/:orgName/jobsjobsorgName
/:orgName/jobs/:idjobs-detailsorgName, id
/:orgName/localizationslocalizationsorgName
/:orgName/localizations/:languageedit-localizationsorgName, language

Site routes

PathNameParameters
/:orgName/plugins/*pluginsorgName
/:orgName/:siteName/plugins/*plugins-siteorgName, siteName
/:orgName/:siteName/sectionssectionsorgName, siteName
/:orgName/:siteName/urlsurlsorgName, siteName
/:orgName/:siteName/lists/entries-listsentries-listsorgName, siteName
/:orgName/:siteName/lists/entries-lists/:idedit-entries-listsorgName, siteName, id
/:orgName/:siteName/entries/:viewIdentriesorgName, siteName, viewId
/:orgName/:siteName/entries/:viewId/:model/:identries-editorgName, siteName, viewId, model, id
/:orgName/:siteName/tagstagsorgName, siteName