Skip to main content

Questions tagged [url]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
147 views

index.php in url for just channel pages

I have followed the instructions for removing index.php and it works on all pages with the exception of pages with channels. So I would see http://www.example.com/index.php?p=news/2016/news-title. I ...
Matthew Carleton's user avatar
2 votes
2 answers
1k views

Does it make sense to use Craft with relative links?

A coworker of mine asked me if I could make the links in Craft relative. Which is not a big deal for navigation links, relative url: {% set relativeUrl = entry.url|replace((siteUrl), '/') %} but ...
Marco Schuler's user avatar
1 vote
1 answer
510 views

How can I localize a URL in a plugin?

UrlHelper::getUrl() doesn't appear to take the current locale ID into account when generating a URL. Absolute URLs are fine as it handles that but is there a best practice way to localize relative ...
Russ Back's user avatar
  • 1,503
2 votes
1 answer
467 views

Bilingual site page URL issues

I'm trying to setup a bilingual site and I'm having some issues with setting up the URI. 'siteUrl' => array( 'en' => 'http://localhost/mysite', 'fr' => 'http://localhost/mysite/fr',...
Eric Chantigny's user avatar
0 votes
1 answer
145 views

Channel with URLs based on entry type

Example: I have content which could be separated into Big News and Small News. The Big News has much text (which would need a link to its own entry). The Small News has only one text block (so it ...
KSPR's user avatar
  • 3,786
1 vote
1 answer
257 views

Nest Entries from Different Sections

I have 2 separate sections living in the same place on my site. Example: About (Single-type Section) Team (Structure-type Section) So in the URL I need to nest Team underneath About, i.e. /about/...
kmgdev's user avatar
  • 1,199
1 vote
1 answer
338 views

How can I create and validate against a url token?

I am (attempting) to and for the most part succeeding in sending an email from a plugin. My plugin has a textarea in the settings that allows the user to customize the message. The message looks ...
Damon's user avatar
  • 4,706
3 votes
1 answer
489 views

Include related entry slug in URl

I've got a channel named "locations" that has an entry fieldtype which allows me to select the corresponding store/brand (limited to 1). How can I define the slug of the related entry in Entry URL ...
Mark H.'s user avatar
  • 401
2 votes
1 answer
1k views

How can I get an entry based on category and slug (via url segments)?

I am using (and have used) this S.O post to create a product filter/search using multiple categories. Everything is working perfectly. I am attempting to use the same type of logic to grab ultimately ...
Damon's user avatar
  • 4,706
2 votes
1 answer
1k views

How to redirect with error messages?

If validation fails in plugin, how can I redirect it bank to previous URL with errors? craft()->urlManager->setRouteVariables(array( 'errors' => $errors )); gives 404 My Controller: ...
Volatil3's user avatar
  • 223
3 votes
1 answer
476 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 ...
Rob's user avatar
  • 865
0 votes
1 answer
271 views

Deleted page URLs

We're having a bit of a problem with the unique URL system in Craft. An entry was deleted, and a new one has been created to replace it. However the new entry should have the same URL as the old ...
Ian Nebbiolo's user avatar
2 votes
1 answer
95 views

Does Craft support international urls?

If I create an entry with international characters in urls? e.g. for Polish language? If I create an entry with the word "ułatwienia" in the url, it doesn't work (I get Craft serving up the 404 page),...
Ieuan's user avatar
  • 21
1 vote
2 answers
326 views

Issue accessing single entry from within category template

I've got a product section on a website where individual product entries are categorised. On the section landing page all the products are listed organised by category. On the individual category ...
Cole Henley's user avatar
  • 1,741
3 votes
3 answers
2k views

redirect index.php in urls on Craft site to NEVER show index.php

We’ve recently had some issues with a staging site being down and it turned out the reason for this was: In the words of Brad at Pixel and Tonic, the redirect is "intercepting the update request for ...
Lee Jacobsz's user avatar
2 votes
2 answers
946 views

Control Panel URLs being rewritten to use index.php?p=admin/

All of our control panel URLs are being rewritten to show index.php?p=admin/*** While this isn't a problem in itself we can't determine why it's happening when the frontend of the website itself is ...
Boxhead's user avatar
  • 33
1 vote
1 answer
436 views

URL Encode only file name

is there any built-in way to encode malicious file name characters when getting an asset URL through assetHandle.getUrl('transformationName')? My system contains files with names such as /assets/...
Jan Klan's user avatar
  • 215
5 votes
2 answers
2k views

Get the Category name into the URL for an entry

I have a gallery which is categorised. The gallery is a Structure section where the user adds an entry and then assigns it to a category - all good. At the moment, when clicking on an entry title the ...
Martin's user avatar
  • 1,203
2 votes
2 answers
7k views

Get query string param that has no value

Is it possible to determine whether or not a query string has a param with no value. For example http://www.test.com?myparam Technically that's a valid url but the craft.request object doesn't ...
Derrick Grigg's user avatar
1 vote
1 answer
173 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 ...
Rob's user avatar
  • 865
2 votes
2 answers
493 views

Case sensitive Channel urls problem

So I have a few different channels for different types of content. One called pages which is just for regular web pages. All of those entries work uppercase or lowercase so example.com/About and ...
Bowenac's user avatar
  • 811
2 votes
1 answer
764 views

Setting up redirects from routes.php

I have a "/5minutes" url in routes.php and people keep typing in "fiveminutes". Is there a way to call a 301 redirect directly in routes.php or would I need to set up an action in my plugin (or ...
David Rampersad's user avatar
5 votes
1 answer
454 views

Output localized urls in navigation

Does {{ url('handle') }} output the right url for localized sites? I have a fr/en site and both lang output the english paths, but shows the right content and language/strings on the page. I'm a bit ...
jlcharette's user avatar
0 votes
1 answer
1k views

Changing root folder name

I would like to change the root folder name where my Craft install is currently at. for example: website.com/dev to website.com/draft1. When changing the folder name on my server and the site URL in ...
user3230327's user avatar
3 votes
1 answer
480 views

Do assets have to be below public_html to access them in redactor?

I love that Redactor lets you choose existing entries, categories, and assets! I am trying to set up a 'Files' source whose File System Path would be something like /home/hostingaccount/craft/files ...
kr37's user avatar
  • 1,355
2 votes
1 answer
298 views

Setting Date from URL

I have a template, /calendar, which outputs a list of all entries from the events channel. If a user clicks a link for "July 2015", I want the same template to load showing only the events for July ...
Philip Jones's user avatar
0 votes
1 answer
82 views

How can I access variables only declared in a template?

I have a template inside a folder located in /templates that is not related to any entry or section: /folder/test.html {% extends '_layout' %} {% set title = 'myTitle' %} {% set ...
neoDev's user avatar
  • 285
0 votes
1 answer
113 views

Performance hit from Entry Url Format with multiple {% if %} clauses?

With help from this answer, I've got an Entry Url Format that can include top, 2nd, or 3rd-level categories. It works for any of these situations: top-level-category/entry.slug top-level-category/...
kr37's user avatar
  • 1,355
6 votes
1 answer
1k views

How to add year and month to Entry URL Format

I'd like to make the Entry URL format of a channel look like this: /news/2015/06/my-slug-here What would I need to enter into the Entry URL Format field in order to do this? The closest I could ...
Stephen's user avatar
  • 685
1 vote
1 answer
348 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 ...
Bezruki's user avatar
  • 13
2 votes
1 answer
914 views

Another index.php?p= problem

I can't get rid of that pesky index.php?p= from my urls. http://mysite.com/index.php?p=about/people If I manually remove index.php?p= e.g. http://mysite.com/about/people it works, but then goes back ...
Samsull's user avatar
  • 151
0 votes
1 answer
212 views

Simple linkage to singles

For some reason there is not really a clear mention on the Craft documentation about this. And I couldn't really find anything in here that explains it either. I know this is kind of basic knowledge ...
GeirrBenayahu's user avatar
2 votes
1 answer
2k views

How to Make getURL Output Complete URL (rather than root relative)

I'm using getURL() as follows in my Craft template: {% set sharingImageURL = entry.sharingImage[0].getUrl('socialMedia') %} Every time the output is a root relative URL and I'd like it to be a ...
dpayne's user avatar
  • 659
2 votes
1 answer
1k views

Home page won't load without 'index.php'

On a fresh install of Craft 2.3.2644, using the hostname alone, example.com returns an error, "The page cannot be displayed because an internal server error has occurred". If I include /index.php (...
Philip Jones's user avatar
1 vote
0 answers
246 views

Two domains, one server with Craft installed

I already have Craft running on a single domain name successfully. For my client, we've bought a second domain name for a mini site for SEO purposes, some of which we'd like to use Craft on. What ...
Pathfinder's user avatar
4 votes
2 answers
1k views

Custom navigation URLs?

I have an existing ExpressionEngine site which I'm looking at moving to using Craft instead. Only really had a quick cursory glance at the system so far but a little confused on a few things. Say ...
Mark Bowen's user avatar
2 votes
1 answer
114 views

404 when clicking on the Disqus embed urls

I've just noticed on a site that the Disqus comment embed is suggesting other articles but they're adding a token to the end of the URL, for example: http://australia.thegospelcoalition.org/article/...
Steven Grant's user avatar
  • 1,855
3 votes
2 answers
7k views

Force trailing slash on URLs

This is an .htaccess question which I found the answer to but, I need to integrate it with the .htaccess that comes with Craft. I need to add trailing slashes to the end of all URLs. I know there is ...
Natetronn's user avatar
  • 1,375
2 votes
1 answer
55 views

When accessing a Category url is there direct access to the Category's fields?

I have setup a category group to use Url's. When navigating to that url does the template have direct access to that category's inputs like you would with and entry? Or do you have to use the segment ...
a-am's user avatar
  • 2,857
1 vote
1 answer
2k views

getUrl() not working

I have the following code in the “main.twig” template: <head> {% block head %} <meta property="og:image" content="{% block pageImage %}{% endblock %}" /> {% endblock %} &...
Martin Adams's user avatar
1 vote
1 answer
2k views

How do I get the last uri segment from within a plugin (php)

I have some validation that checks for a unique email when creating a new person. Works great. When I am updating the person, it's no surprise the system won't let me save because the email I am ...
Damon's user avatar
  • 4,706
0 votes
2 answers
100 views

My Entry URL Format needs are too long for the field restrictions

I'm trying to set the URL of my product entry's to be dynamically created based on 3 category fields and 2 number fields. The category fields are required, but I need to add some logic for the number ...
Chandra's user avatar
  • 42
2 votes
1 answer
1k views

omitScriptNameInUrls is not working

I think I've just about hit my wits end here. I'm trying to get set up on a new Rackspace server and I can't seem to get my URL rewriting to work properly. Here's what I got so far: My Craft install ...
Jon's user avatar
  • 345
2 votes
1 answer
456 views

Get 404 Error When Going to mydomain.com/news

Craft newbie here. I have been playing with craft now for a few weeks and built out a couple of pages. I am really liking it this CMS. The one small problem that I just noticed however, is when I ...
Vince M.'s user avatar
2 votes
1 answer
614 views

How do I build a link from variables?

I'm building an entry type's menu, automatically populated with several sections. A route for dynamic menu had to be also created. Code {% set section = craft.sections.getSectionByHandle('...
Dominik Krulak's user avatar
1 vote
1 answer
118 views

Is there a way to add a url(not to the file itself) to assets?

I am testing Craft to see if it would be a good fit for sites I build. At this point, I do feel it is great and might fit most of the work I do. The only thing I can't figure out is how I could add ...
Eric Chantigny's user avatar
1 vote
1 answer
67 views

Pathed URL creation from templated files

I've encounterd a problem with URL creation. In my plugin I have the following. public function registerSiteRoutes() { return [ 'korting/zoeken' => array('action' => '/discount/...
Terraskye's user avatar
1 vote
1 answer
98 views

Lookup element by URL

I'm trying to get an element from it's URL. For example, say we have a url of http://craft.dev/blog/article1. Is there a function I can call within a plugin and pass over blog/article1 that will ...
Nicholas LeBlanc's user avatar
3 votes
2 answers
674 views

Is there any easy way (via the admin panel) to get a direct link for an asset?

A client wants to be able to get URLs for assets (for, eg. pasting a direct link into an email). For images and PDFs, "View file" works nicely (the file opens in a new browser tab), but for other file ...
Nick F's user avatar
  • 1,215
1 vote
1 answer
946 views

Whats the best way to create short URL's

I have a client that wants to create a short URL to an entry for a mail shot. What would be the best way to do this. I have the Reroute plugin installed which would work (setting to a 302 redirect) ...
Gareth's user avatar
  • 1,605