Questions tagged [routes]

Questions about how Craft handles a request.

12 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
250 views

Multi-locale is not working with routes

I have a localization problem where the routes are not showing up. I have a tried a routes file with the following code. return array( 'menu' => '_menu' ) And its working on the main language ...
1
vote
0answers
42 views

Invalid Route in module

I'm new to craft and slowly learning how to use more advanced features. I'm trying to write a module with a controller. When the route is invoked on a fetch call I get the following error: HTTP 404 – ...
1
vote
0answers
25 views

Route with unspecified number of segments

I have entry which has route like this: category1/category2/.../entry-slug There can be an unspecified number of categories - these are multilevel structure entries. I want to add an entry edit ...
1
vote
0answers
22 views

How to append current version to post URL - versioning a post

I'm middle of a PWA app and one of the problems facing is versioning, once the post cached using Service Worker and if any change amended(ex: if it is an event post, the event end date may be extended....
1
vote
0answers
75 views

Add optional segment to Craft Commerce product Url

I currently have a Craft Commerce site where the product url is setup like this: {productCategory.level(1).first().slug}/{productCategory.level(2).first().slug}/{productCategory.level(3).first().slug}...
1
vote
0answers
132 views

Alter the routing in Craft for every URL independent of language

How can I alter the routing in Craft? I need to add a (variable) segment to every possible URL. The reason is we have a multi lingual site with multiple regions. We need to know the correct region in ...
1
vote
0answers
262 views

How do I use the section Entry URL format for registerSiteRoutes() in a plugin?

I'm trying to register a site route in my plugin based on the Entry URL format for a section chosen in the plugin settings. So if it's the default news section in the Craft install the URL format ...
0
votes
0answers
24 views

Route issues, error Undefined index: uriPattern

My front end gives the following error: Undefined index: uriPattern after changing some code in a template that I changed directly through FTP instead of pushing it through GIT. When I go to /settings/...
0
votes
0answers
12 views

Why is $I->submitForm() always loading the homepage in functional tests?

For some reason whenever I try to use $I->submitForm() in functional tests for a form on the homepage, the homepage is loaded instead of the form action no matter what the form action is set to. I'...
0
votes
0answers
32 views

Setting an entry in a dynamic route template

I have some routes i want to use like "/my-url/locationZ" "/my-url/locationX" This loads a template /dynamic.twig In the template dynamic I am trying to get the content from an ...
0
votes
0answers
129 views

How can i get the current applied route in CraftCMS?

I'm using a dynamic route that loads a template. I'm on a multisite setup with a language switch in the header menu. To be able to switch between sites or languages, the dynamic routes need to have ...
0
votes
0answers
62 views

Can I add information to a CP new entries page?

I would like to add a google map in an entry edit page for certain entry types. I already have a plugin started to go and grab the lat and long for the entered address. What I'm now trying to ...