Questions tagged [routing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
197 views

Do dynamic routes depend on url rewriting?

I need to set up a custom route for a particular page, but can't seem to get anything to work. For instance, I set up this route: From what I gather, this should match just about anything... mysite....
0
votes
2answers
400 views

How do I wire my form action to my controller action?

I'm writing my first Craft CMS plugin. I have the following tag in my form: <input type="hidden" name="action" value="clientnameDonation/donateForm/donate"> And then I have the following ...
1
vote
1answer
758 views

Custom URL based on Categories

I am very new to this CMS and I was able to set it up, import some content from csv files. I have set up templates and right now if someone clicks on the article, the URL is www.example.com/articles/{...
1
vote
2answers
1k views

Craft Routing / Variables with Differing URI

I have a project which I'm working on which is going to need something similar to the following URL Structure : site.com/dfe45c4f/news_title, site.com/gyb66dx/news_title or site.com/76vvg3s/...
3
votes
1answer
147 views

ElementAPI endpoint routing syntax for multi-level structure

Would like to be able to handle requests for structured requests so that it may be handled in one endpoint about.json about/the-team.json about/contact/london.json Presumably a form of ...
1
vote
1answer
84 views

Creating HTML and Text version of entry via different templates

So I'm using Craft to create code to be pasted into a blast email program. My standard template is at the following: newsletter/_entry However, I'm having trouble getting the text version to display ...
1
vote
0answers
56 views

Overriding Craft's default routing process [duplicate]

I have a situation where I'd like to have an entry exist with a particular URL structure by placing it within an existing structure. Let's say this URI is: /one/two/three Where 'three' is the entry ...
2
votes
1answer
577 views

How to troubleshoot routes

Very new to Craft CMS... My first route, which i think is very simple, is not working, i'm getting a 404 error. How can I troubleshoot routing? My settings: If the URI looks like this: databases/ ...
5
votes
1answer
702 views

Installing other PHP app in sub directory

My question is the opposite of this question: Installing Craft in sub directory I have a Craft website and I need to put a Laravel application in a sub directory, it almost works. I have made the ...
0
votes
1answer
220 views

Get entry route

I'm trying to create a dynamic rerouter based on reroute plugin, but with the improvement to automatically create a reroute when a new entry is saved. So I listen for the entries.onSaveEntry event, ...
3
votes
1answer
98 views

Set a dynamic `activateAccountSuccessPath`

How to set a dynamic path for activateAccountSuccessPath that contains the username (or any other field from the user profile)?
2
votes
2answers
837 views

How to redirect site root to preferred language in multi-language site?

I followed the Craft directions for setting up a localized site. In the fifth step I followed the first example for setting up my folder structure. In my case the languages I'm working with are French ...
1
vote
1answer
529 views

Displaying entires by year from a custom date field

I have a date field (date) in my entry and I wish to get all entries of a specified year. Can’t figure it out at all. Here’s what I have now, to sort them by that field: craft.entries.section('...
1
vote
0answers
257 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 ...
2
votes
1answer
80 views

How do I setup my Element Types Sources for deep linking?

In the Entries tab in the Control Panel, I see a list of Sources on the left hand side: All Entries Singles News When I click on each of these sources the page filters the appropriate results in the ...
0
votes
1answer
450 views

Direct access call for a twig template from a twig template gives 404

I'm trying to call for a Twig template _template from a Twig template, particularly from within AngularJS <script type="text/javascript"></scirpt> tags. A console log says, that the file ...
0
votes
2answers
117 views

B2B and B2C split

I need to have B2B and B2C split. I was thinking to use the same templates and work with conditionals in the templates. it's only for 20% of the content that is different, but still all urls should ...
0
votes
1answer
477 views

Getting Page Not Found error for my custom subdomain setup

I want to setup a new custom subdomain (va.domain.com) within the project of my existing domain (craft.domain.com) using homestead. So I referred to this this answer on craftexchange and followed all ...
1
vote
1answer
749 views

Craft Controller gives 404 error

So I am working on it first time. I created a Controller DB_DuhController having a method actionFoo() I am then calling it as http://domain.craft.dev/admin/DB/duh/Foo but it's giving 404 all the time....
3
votes
2answers
1k views

Controller action redirection when called via route

I have a route set up in routes.php that calls a controller action using something similar to what is described here: https://straightupcraft.com/articles/how-do-i-setup-a-route-to-point-to-a-...
3
votes
1answer
367 views

Override a wildcard dynamic route template

I have a dynamic route for individual user /profiles. I expected it would be possible to override this route for /profiles/all but apparently not. This can be achieved in the template I expect, with ...
2
votes
1answer
825 views

Controller Action 404

Ok once again I'm having an issue with a plugin controller. It was working once upon a time but stopped sometime in the past year. I have stripped the plugin down to bare, so there is no reason it ...
1
vote
1answer
140 views

Installing Moodle to a Craft CMS server

I was wondering if anyone had any experience in installing Moodle to a server that already had a CraftCMS website installed onto it? I've followed the instructions on the Moodle Installation Guide (I ...
1
vote
1answer
311 views

Route / to specific template

I'm trying to route the homepage / to a specific template. In my routes.php file, i've tried these two without result: return array( '/' => 'specific/_entry', '' => 'specific/_entry', );...
1
vote
1answer
57 views

Asset routing issue in combination with slug and date

Normally I add images to a post through a field for it, but now I thought I'd just use the uploader in the text/newspost field. However, this gives me the following problem. When on index.htm for the ...
3
votes
1answer
392 views

Route token that includes forward slashes

I'm setting up a route in control panel. I'd like to use a token that is similar to asterisk but involves forward slashes. Here's an example: I want to route everything from site.com/blog/* to a ...
1
vote
2answers
758 views

Redirects or Routing for Landing Page URL's?

I am trying to set up a channel that uses different content for a series of Google Adwords landing pages. I set up the channel template as /landing-pages/_entry I'd like to remove the /landing-pages/...
0
votes
1answer
221 views

Error while trying to use dynamic routing to pass variables to the template and using them

So i'm trying to pass the variables from a dynamic route to a template and then to use those variables to filter trough entries. the catch is that the same template is used to display an "organic"(by ...
4
votes
1answer
285 views

Prevent ALL templates from being rendered directly? [closed]

I attempted to set the privateTemplateTrigger to an empty string in my config/general.php file, because I don't ever want Craft to serve up a template file on its own just because a visitor happens to ...
1
vote
1answer
151 views

Public profile page: requesting user ID with dynamic url routing

I've been referring to this question (can't comment as I don't have enough cred) — The most popular answer works, but I can't for the life of me figure out why Brad's version doesn't. When I try I get ...
1
vote
1answer
222 views

Custom subdomain routing with a pluign

I need to serve different home pages (structure entries) depending on the subdomain. For example: foo.example.com -> this will render an entry with slug "foo" bar.example.com -> this will ...
0
votes
1answer
139 views

need file extension in url to access template

I've got a structure setup, and one of the entries under it is called "Our people" at the top level, in the "About" structure. So the url would look like this: /about/our-people. I have a template ...
0
votes
1answer
217 views

Multi-domain routing not working

I've followed this answer for running a Craft install based on two domain names. I thought it was working but either I was wrong, or something's changed, because it's not now. I have a.com (where the ...
1
vote
1answer
334 views

Where to place a front-end 'entry form'?

I'm trying to add an entry form outside CP (for users with proper permissions), using this example: http://buildwithcraft.com/docs/templating/entry-form but there's no mentioning of how/where to add ...
2
votes
1answer
209 views

Is it possible to route to www.site.com/username?

So what I'd like is: If URI would look like {username}, load _thisTemplate. Couldn't find the way without solid point like author ID.
0
votes
1answer
476 views

Routes + Expired + Slugs

I have a listing of entries at /events that loads events/index I also have a custom route setup to be able to list 'live' entries by week 'events/(?P<year>\d{4})/(?P<week>\d{2})' => '...
0
votes
1answer
668 views

How can I reroute this querystring URL?

In my routes file I have this: 'micros-test/guest-booking/(?P<bookingId>[a-z0-9-]*)' => 'micros-test/guest-booking', Which works fine for URLS like this: /en/micros-test/guest-booking/...
0
votes
0answers
59 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 ...
3
votes
1answer
896 views

Multi-Domain routing

We are launching 2 different sites, using the same craft installation on multiple domains. a.com and b.com a.com points to the main craft install b.com should point to a subpage/single in this same ...
4
votes
2answers
2k views

Show entry in channel based on URL segment

Short Question: I'm coming from ExpressionEngine where 'dynamic' would do the trick. However I can't seem to figure out how to do this in Craft. I want to be able to use one Channel to show content ...
5
votes
1answer
399 views

“Subtemplates” for entry using routing?

Suppose I have a section for Products, that uses the template at products/_entry and is set up to have the URL format of 'products/{slug}'. Our existing page structure shows a Product page when you ...
5
votes
1answer
2k views

Rendering templates from plugin controller

Right now I'm trying to accomplish routing users through a controller action before rendering the plugin's CP template... [Plugin]Plugin.php // ... public function registerCpRoutes() { return [...
1
vote
1answer
399 views

Multi-lingual site without subfolders

Would it be possible to have a cleaner site setup without all those 'locale' subfolders in the webroot? Somehow it looks like there's something similar already done here (https://github.com/craftcms/...
2
votes
1answer
104 views

Have Craft deliver single page despite having a directory of the same name in the public folder?

I just switched my company's website to Craft, and I have a lot of already existing static webpages that I would rather not remake as templates and define routes for. I have a single page made in ...
2
votes
1answer
63 views

All templates automatically private

Is there a way to make all templates automatically private? Or do I really have to put an _ before every single one?
0
votes
1answer
605 views

Route to Controller action (not in a plugin)

Let's say i have a FooController extending Craft\BaseController located somewhere else (not in a plugin). The FooController is autoloaded via composer and the autoload.php is included in public/index....
2
votes
2answers
854 views

Overriding a structure section's template for a single structure entry

When you create a structure section you set which template that you would like to use. Is there a way to override that for a single entry in that structure? If I have missed it in the docs I apologise ...
0
votes
1answer
791 views

How to load a template based on the first segment (and ignoring the second)

So I have my dinnermenu at example.com/dinnermenu but I want to show specific content for the next week if someone asks for it via example.com/dinnermenu/nextWeek but it should still use the entry ...
3
votes
2answers
2k views

Is it possible to route a subdomain to specific template group?

We are looking for a way to route a subdomain to a specific template to use as a landing page. Is there a way to do this without routing through index.html and redirecting to the specified template ...
2
votes
2answers
241 views

Working with Structure & Multiple Pagetypes

I have a site that's mostly 'static' content pages, with a few dynamic & more complicated pages mixed in. To make editing & setting up the navigation easy, I started by creating a Structure ...