Returns a list of Craft/Vue/React route rules and element URLs for ServiceWorkers from Craft entries

Overview

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

Route Map plugin for Craft CMS 3.x

Returns a list of Craft/Vue/React route rules and element URLs for ServiceWorkers from Craft entries

Screenshot

Related: Route Map for Craft 2.x

Requirements

This plugin requires Craft CMS 3.0.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require nystudio107/craft-routemap
    
  3. Install the plugin via ./craft install/plugin route-map via the CLI, or in the Control Panel, go to Settings → Plugins and click the “Install” button for Route Map.

You can also install Route Map via the Plugin Store in the Craft Control Panel.

Documentation

Click here -> Route Map Documentation

Route Map Roadmap

Some things to do, and ideas for potential features:

  • Add support for Commerce Products / Variant URLs

Brought to you by nystudio107

Comments
  • Endpoint get-all-route-rules is not working

    Endpoint get-all-route-rules is not working

    The endpoint /actions/route-map/routes/get-all-route-rules?siteId={siteId} is not working and return empty sections and categories.

    The reason seems to come from here

    src/craftCMS/vendor/nystudio107/craft-routemap/src/services/Routes.php
    
    public function getSectionRouteRules(string $section, string $format = 'Craft', $siteId = null): array{
       ...
      foreach ($sites as $site) {
                        if ($site->hasUrls && ($siteId === null || $site->siteId === $siteId)) {
      ...  
    }
    

    $site->siteId is a integer $siteId is a string

    So the condition is never met.

    Maybe is the Craft CMS version that cause this issue. But maybe cast to the same type will prevent this kind of issue on other version.

    Plugin version: 1.1.6 Craft CMS version: 3.5.9

    Thanks for your good work.

    opened by jlachancekffein 3
  • craft_routes doesn't exist

    craft_routes doesn't exist

    When I request: /actions/route-map/routes/get-all-route-rules

    I get the following error: Base table or view not found: 1146 Table '[database-name].craft_routes' doesn't exist

    Am I missing something, or has there been an update that brakes your plugin?

    opened by clieee 3
  • [FEATURE] Ability to request pathname only

    [FEATURE] Ability to request pathname only

    Would be great to just get back the pathname instead of the full URL (for example, Nuxt.js wants jus the paths for generating dynamic routes)

    So instead of this

    [  
      "http://craft.local/news/another-news-entry",
      "http://craft.local/news/my-first-news-entry",
      "http://craft.local/work/fueling-the-good-design-movement",
      "http://craft.local/work/land-of-the-freestyle",
      "http://craft.local/work/case-study-3"
    ]
    

    I would like to get back

    [  
      "/news/another-news-entry",
      "/news/my-first-news-entry",
      "/work/fueling-the-good-design-movement",
      "/work/land-of-the-freestyle",
      "/work/case-study-3"
    ]
    

    FYI, my current URL looks like this http://craft.local/actions/route-map/routes/get-section-urls?section=workDetail,newsDetail

    I know I could just modify the array back in JavaSCript land... but if it's something easy to add to this plugin I figured it doesn't hurt to ask!! Thanks!

    enhancement 
    opened by stursby 2
  • Category support

    Category support

    • Added getCategoryRouteRules function
    • Added getAllCategoryRouteRules function
    • Added getCategoryUrls function
    • Changed getAllRouteRules to getAllSectionRouteRules. getAllRouteRules now returns a nested array of all sections and all categories
    • Updated getAllRouteRules function to include all categories routes too
    • Added constant ROUTEMAP_CATEGORY_RULES name
    • Changed constant ROUTEMAP_RULES to ROUTEMAP_SECTION_RULES
    • TODO: Update the Read Me with details on the functions
    opened by marknotton 2
  • Get-all-urls not working

    Get-all-urls not working

    Describe the bug

    Get-all-urls not working, $element Class is a string not an type of elementInterface in https://github.com/nystudio107/craft-routemap/blob/develop-v4/src/services/Routes.php#L467

    The string contains 'craft/elements/Address'

    "name":"Exception","message":"nystudio107\\routemap\\services\\Routes::getElementQuery(): Argument #1 ($elementType) must be of type craft\\base\\ElementInterface, string given, called in /Users/site/vendor/nystudio107/craft-routemap/src/services/Routes.php on line 469","code":0,"type":"TypeError","file":"/Users/site/vendor/nystudio107/craft-routemap/src/services/Routes.php","line":616,"stack-trace":["#0 /Users/site/vendor/nystudio107/craft-routemap/src/services/Routes.php(469): nystudio107\\routemap\\services\\Routes->getElementQuery('craft\\\\elements\\\\...', Array)","#1 [internal function]: nystudio107\\routemap\\services\\Routes->nystudio107\\routemap\\services\\{closure}(Object(craft\\cache\\FileCache))","#2 /Users/site/vendor/yiisoft/yii2/caching/Cache.php(607): call_user_func(Object(Closure), Object(craft\\cache\\FileCache))","#3 /Users/site/vendor/nystudio107/craft-routemap/src/services/Routes.php(459): yii\\caching\\Cache->getOrSet('ElementUrls130a...', Object(Closure), 30, Object(yii\\caching\\TagDependency))","#4 /Users/site/vendor/nystudio107/craft-routemap/src/services/Routes.php(113): nystudio107\\routemap\\services\\Routes->getElementUrls('craft\\\\elements\\\\...', Array, NULL)","#5 /Users/site/vendor/nystudio107/craft-routemap/src/controllers/RoutesController.php(49): nystudio107\\routemap\\services\\Routes->getAllUrls(Array, NULL)","#6 [internal function]: nystudio107\\routemap\\controllers\\RoutesController->actionGetAllUrls(Array, NULL)","#7 /Users/site/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)","#8 /Users/site/vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams(Array)","#9 /Users/site/vendor/yiisoft/yii2/base/Module.php(552): yii\\base\\Controller->runAction('get-all-urls', Array)","#10 /Users/site/vendor/craftcms/cms/src/web/Application.php(301): yii\\base\\Module->runAction('route-map/route...', Array)","#11 /Users/site/vendor/craftcms/cms/src/web/Application.php(625): craft\\web\\Application->runAction('route-map/route...', Array)","#12 /Users/site/vendor/craftcms/cms/src/web/Application.php(280): craft\\web\\Application->_processActionRequest(Object(craft\\web\\Request))","#13 /Users/site/vendor/yiisoft/yii2/base/Application.php(384): craft\\web\\Application->handleRequest(Object(craft\\web\\Request))","#14 /Users/site/web/index.php(12): yii\\base\\Application->run()","#15 /Users/toni/.composer/vendor/laravel/valet/server.php(234): require('/Users/toni/Sit...')","#16 {main}"]}

    To reproduce

    Steps to reproduce the behaviour:

    1. Go to actions/route-map/routes/get-all-urls (with Craft 4, 4.0.0-beta-2)
    2. See error message

    Expected behaviour

    Showing all public urls.

    Versions

    • Plugin version: 4.0.0-beta-2
    • Craft version: 4.1.0.2
    bug 
    opened by Toni-hr98 1
  • Error (Routes::getDbRoutes) in Craft 4 beta 4 / Routemap 4.0.0-beta.1

    Error (Routes::getDbRoutes) in Craft 4 beta 4 / Routemap 4.0.0-beta.1

    Describe the bug

    Hello i', trying to use {% set pages = craft.routeMap.getAllRouteRules('Vue') %} in a twig template but got this error

    TypeError: nystudio107\routemap\services\Routes::getDbRoutes(): Argument #1 ($siteId) must be of type ?int, string given, called in /home/stephane/Projects/osteo/vendor/nystudio107/craft-routemap/src/services/Routes.php on line 507 and defined in /home/stephane/Projects/osteo/vendor/nystudio107/craft-routemap/src/services/Routes.php:526
    

    I've got a fresh install of craft 4 beta 4.

    Thank you !

    bug 
    opened by stephanedemotte 1
  • Bump minimist from 1.2.5 to 1.2.6 in /docs

    Bump minimist from 1.2.5 to 1.2.6 in /docs

    Bumps minimist from 1.2.5 to 1.2.6.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump prismjs from 1.24.1 to 1.27.0 in /docs

    Bump prismjs from 1.24.1 to 1.27.0 in /docs

    Bumps prismjs from 1.24.1 to 1.27.0.

    Release notes

    Sourced from prismjs's releases.

    v1.27.0

    Release 1.27.0

    v1.26.0

    Release 1.26.0

    v1.25.0

    Release 1.25.0

    Changelog

    Sourced from prismjs's changelog.

    1.27.0 (2022-02-17)

    New components

    Updated components

    Updated plugins

    Other

    • Core
      • Added better error message for missing grammars (#3311) 2cc4660b

    1.26.0 (2022-01-06)

    New components

    Updated components

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump nanoid from 3.1.23 to 3.2.0 in /docs

    Bump nanoid from 3.1.23 to 3.2.0 in /docs

    Bumps nanoid from 3.1.23 to 3.2.0.

    Changelog

    Sourced from nanoid's changelog.

    Change Log

    This project adheres to Semantic Versioning.

    3.2

    • Added --size and --alphabet arguments to binary (by Vitaly Baev).

    3.1.32

    • Reduced async exports size (by Artyom Arutyunyan).
    • Moved from Jest to uvu (by Vitaly Baev).

    3.1.31

    • Fixed collision vulnerability on object in size (by Artyom Arutyunyan).

    3.1.30

    • Reduced size for project with brotli compression (by Anton Khlynovskiy).

    3.1.29

    • Reduced npm package size.

    3.1.28

    • Reduced npm package size.

    3.1.27

    • Cleaned dependencies from development tools.

    3.1.26

    • Improved performance (by Eitan Har-Shoshanim).
    • Reduced npm package size.

    3.1.25

    • Fixed browserify support.

    3.1.24

    • Fixed browserify support (by Artur Paikin).
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump prismjs from 1.24.1 to 1.25.0 in /docs

    Bump prismjs from 1.24.1 to 1.25.0 in /docs

    Bumps prismjs from 1.24.1 to 1.25.0.

    Release notes

    Sourced from prismjs's releases.

    v1.25.0

    Release 1.25.0

    Changelog

    Sourced from prismjs's changelog.

    1.25.0 (2021-09-16)

    New components

    Updated components

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump prismjs from 1.17.1 to 1.24.0 in /docs

    Bump prismjs from 1.17.1 to 1.24.0 in /docs

    Bumps prismjs from 1.17.1 to 1.24.0.

    Release notes

    Sourced from prismjs's releases.

    v1.24.0

    Release 1.24.0

    v1.23.0

    Release 1.23.0

    v1.22.0

    Release 1.22.0

    v1.21.0

    Release 1.21.0

    v1.20.0

    Release 1.20.0

    v1.19.0

    Release 1.19.0

    v1.18.0

    Release 1.18.0

    Changelog

    Sourced from prismjs's changelog.

    1.24.0 (2021-06-27)

    New components

    Updated components

    ... (truncated)

    Commits
    Maintainer changes

    This version was pushed to npm by rundevelopment, a new releaser for prismjs since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
Releases(4.0.0)
Owner
nystudio107
Consulting, Branding, Design, Development
nystudio107
Element Relations Plugin for Craft CMS 3.x

Element Relations Plugin for Craft CMS 3.x This plugin shows all relations of an element. For example, where an asset, entry or any other element is l

Frederic Köberl 2 Jul 18, 2022
Generate a CMS element scaffolding within seconds.

Generate CMS elements or blocks Tired of creating the whole folder structure for a CMS block or element? With this plugin you can create the scaffoldi

Shape & Shift 26 Nov 4, 2022
A simple extension that adds the a CMS Edit link to an element that is inline-editable

SilverStripe Elemental Advanced Edit A simple extension that adds the a CMS Edit link to an element that is inline-editable. Created as work-around to

Robert van Lienden 5 Sep 19, 2022
Craft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond.

About Craft CMS Craft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond. It features: An intuitive, user-

Craft CMS 2.9k Jan 1, 2023
Plugin Vite is the conduit between Craft CMS plugins and Vite, with manifest.json & HMR support

Plugin Vite Related Articles: Vite.js Next Generation Frontend Tooling + Craft CMS A Vite Buildchain for Craft CMS Plugins Requirements Craft CMS 3.0.

nystudio107 8 Dec 30, 2022
Plugin for Craft CMS that makes it easy to interact with the Instagram Basic Display API and Instagram oEmbed.

Instagram Basic Display plugin for Craft CMS 3.x This plugin creates endpoints in your Craft install for you to consume the Instagram Basic Display AP

Jonathan Melville 5 Dec 20, 2022
Provides autocompletion for Craft CMS and plugins in Twig templates.

Autocomplete for Craft CMS Provides autocompletion for Craft CMS and plugins in Twig templates. Currently works with PhpStorm only, as VSCode does not

PutYourLightsOn 12 Nov 23, 2021
Allows the use of the Vite.js next generation frontend tooling with Craft CMS

Vite plugin for Craft CMS 3.x Allows the use of the Vite.js next generation frontend tooling with Craft CMS Related Article: Vite.js Next Generation F

nystudio107 38 Dec 30, 2022
Provides Twig template IDE autocomplete of Craft CMS & plugin variables

Autocomplete for Craft CMS 3.x Provides Twig template IDE autocompletion for Craft CMS and plugin/module variables and element types. Works with PhpSt

nystudio107 35 Dec 21, 2022
A BlurHash implementation for Craft CMS.

BlurHash plugin for Craft CMS 3.x Render a BlurHash from a given asset in Craft CMS. A BlurHash is a compact representation of a placeholder for an im

Dodeca Studio 8 Nov 12, 2022
Edit richt text content in Craft CMS using Article by Imperavi.

Article Editor About the plugin This plugin brings the powerful Article Editor from Imperavi to Craft CMS, allowing you to make create beautiful rich

Creativeorange 6 Mar 30, 2022
Monet Plugin for Craft CMS

A Monet field can be added to asset elements which will generate and store an efficient placeholder image to be displayed inline, whilst the full asset is loading.

Chris Dyer 1 Jan 21, 2022
Provides a twig editor field with Twig & Craft API autocomplete

Twigfield for Craft CMS 3.x & 4.x Provides a twig editor field with Twig & Craft API autocomplete Requirements Twigfield requires Craft CMS 3.0 or 4.0

nystudio107 13 Nov 1, 2022
:star2: PJ Blog is an open source blog built with Laravel and Vue.js.

?? PJ Blog is an open source blog built with Laravel and Vue.js. https://pigjian.com Special thanks to the generous sponsorship by: PJ Blog This is a

Jiajian Chan 2.8k Dec 28, 2022
Vuedo is a blog platform, built with Laravel and Vue.js.

Vuedo What is Vuedo? Vuedo is an open source project built with Laravel and Vue.js. It is a live example of how everything works together. Interested

vuedo 2.3k Dec 24, 2022
A simple SPA blog applications built with Laravel 8, Vue 3 and Inertia JS.

TechPost - SPA Blog A single page blog application, built with Laravel 8, Vue 3 and Inertia JS TechPost is a minimalistic single page blog application

FariazKhan 5 Jul 23, 2022
Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.

Jetpack Monorepo This is the Jetpack Monorepo. It contains source code for the Jetpack plugin, the Jetpack composer packages, and other things. How to

Automattic 1.4k Jan 7, 2023
Baicloud CMS is a lightweight content management system (CMS) based on PHP and MySQL and running on Linux, windows and other platforms

BaiCloud-cms About BaiCloud-cms is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the

null 5 Aug 15, 2022
Drag and Drop Website Builder and CMS with E-commerce

Microweber: Drag-and-Drop CMS Current version: 1.2 running on Laravel 8! Download | What is Microweber? | Core features of Microweber | Requirements |

Microweber 2.6k Dec 31, 2022