Questions tagged [url]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
263 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 ...
0
votes
1answer
76 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 ...
0
votes
1answer
107 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/...
5
votes
1answer
783 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 ...
1
vote
1answer
340 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
830 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 ...
0
votes
1answer
203 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 ...
2
votes
1answer
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 ...
2
votes
1answer
906 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 (...
1
vote
0answers
237 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 ...
3
votes
2answers
890 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 ...
2
votes
1answer
105 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/...
2
votes
2answers
6k 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 ...
2
votes
1answer
51 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 ...
1
vote
1answer
1k 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 %} &...
1
vote
1answer
1k 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 ...
0
votes
2answers
90 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 ...
2
votes
1answer
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 ...
2
votes
1answer
445 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 ...
2
votes
1answer
508 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('...
1
vote
1answer
114 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 ...
1
vote
1answer
61 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/...
1
vote
1answer
82 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 ...
2
votes
2answers
575 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 ...
1
vote
1answer
617 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) ...
1
vote
1answer
766 views

customised slugs using custom field

I have a 'Profile' channel that gives the profile of people. I have 'Last name' as the title, 'first name' and I'd like to use first name in the slug rather than have to add the first name to the ...
2
votes
1answer
344 views

How do I use Plain Text Field in URL Format?

I'm creating an events system & I want to include the venue in the url of the event along with the event name. For now the venue name is just stored using a plain text field. Is there an easy ...
2
votes
1answer
228 views

Nice-looking URLs for assets

Is there a way to get "vanity URLs" for my assets? Something like: www.example.com/download/asset.pdf rather than: www.example.com/several/subfolders/for/organisation/purposes/asset.pdf I know ...
3
votes
1answer
829 views

How do I make the “%20” in URL's show as “-”

I'm building a site where I am linking entries based on their tags. If you click on a tag you go to a dedicated page with all entries that share the same tag. {% for tag in craft.tags.relatedTo(entry)...
1
vote
1answer
857 views

if entry has same url segment

I have a Structure that has the URL setup like this.. Top-Level Entries - {slug} Nested Entries - {parent.uri}/{slug} How do I list all entries that have the same segment1 of their URL as to what is ...
4
votes
2answers
1k views

URL Redirect Not Working

Seems like I can't get the base install URL to work. To get Craft to show posts I have to format the URL as, /public/index.php?p=news/2015/we-just-installed-craft Instead of just the /news/2015/we-...
5
votes
3answers
4k views

How do I get the url of single pages?

I've been struggling all evening with getting the urls of my singles in a menu generator. At first I thought I nailed it, but it turned out it used the title of the singles instead of the url. When I ...
1
vote
1answer
280 views

Matrix Gallery, with every image having it's own unique URL?

As of right now I have nine or so structures created, each including it's own Image Gallery created in a Matrix. Is it possible to give each image inside that matrix a unique URL? What I'm trying to ...
1
vote
1answer
218 views

How to redirect a url with a query to one that does not have a query

I'm using Redirect Manager (https://github.com/rkingon/Craft-Plugin--Redirect-Manager) and I"m trying to redirect: www.website.com/?post_type=testimonials To: www.website.com/about-us I've tried the ...
2
votes
1answer
2k views

Force download of asset file from template

I have a template called download that receives an asset ID, looks it up and should force the browser to download the file. I've gotten this far with the {% headers %} tag, but I can't figure out how ...
1
vote
1answer
345 views

url with .html extension

I just realized that my page is also accessible when there is a .html extension on the url. The url would be: http://musikwerkluzern.ch/programm but http://musikwerkluzern.ch/programm.html works as ...
4
votes
2answers
597 views

Can I use translated properties for URL formats

Here's my scenario. I have a structure section: "events". Within that I have three entry types: "events", "exhibitions", "specials". I would like the events to follow the following URL structure: {...
3
votes
2answers
241 views

Homepage Takeover

I have a problem which may be very simple to solve, but I just can't get my head around it. I would like to do an alternative landing page if an image has been uploaded to the 'homepage' single ...
1
vote
2answers
271 views

Pass URL parameter through General Config file

This may sound a little odd so let me explain what's going on. In my current setup I have allowed new users to sign up. I want these users to follow this flow: Fill up sign up form and submit Gets ...
11
votes
3answers
2k views

How to set up {siteUrl} to work with both http and https

I'm looking for a way to set up the general.php file's siteUrl to be able to use both http and https. Only the front-end login would be using the https. This is how I currently have it set up: '...
1
vote
1answer
1k views

Request the url of a channel index

How can I request the url for a channel index page from another page. I got this message asked on twitter towards craft, but they misunderstood my question. The came back to me using craft.request....
0
votes
2answers
288 views

Insert a url segment without creating sections

I have a very simple site split into sections. All pages use just one template. The previous site had sections such as /section/subject. I had thought I could have all entries in just one section ...
1
vote
1answer
749 views

How to automatically rename image uploads?

How to automatically rename the image files to a random string during the upload process? For example, I have an image named "big_poster.jpg" and I want it to be saved as something random, for example ...
1
vote
2answers
204 views

Workaround for deprecated regex pattern modifier in PHP 5.5.0 and up (10.10 Yosemite)

I'm relying on the Low Regex plugin to convert section handles from camelCase to lower-dash-case to use them in URLs, like so: {section.handle|regex('/(^|[a-z])([A-Z])/e', 'strtolower(strlen("\\1") ? ...
2
votes
1answer
2k views

URL rewrites not working return Apache 404's

Content is accessible via example.com/index.php?p=page-name but not via example.com/index.php/page-name or example.com/page-name. The .htaccess and 'omitScriptNameInUrls' => true are both in place ...
3
votes
2answers
671 views

Is there a better way to localise channel url?

I'm working on a bilingual site (en and cy) and have a news channel with entry urls news/{slug} and the translated cy/newyddion/{slug}. Everything is working well with entries and if the url is ...
0
votes
1answer
631 views

Where are all the references to the URL stored?

I have my first craft website all working great on my local dev server and want to move it to the production server. I think I went about this the wrong way but I installed a fresh install of craft on ...
1
vote
1answer
1k views

How can I get blog categories and blog entry urls to play nice together?

I'm building a simple blog that has the ability to publish entries: Within a set of categories. With no category set. The URL format of a blog entry is /blog/YYYY/MM/DD/{slug} Everything so far ...
1
vote
1answer
4k views

Correct way to include include scripts

I am including head.html and scripts.html in my template. Most of the scripts load except for 2 yet the path is the same for all of them. I {% include %} them. If I change foundation.min.js to ...
5
votes
1answer
5k views

Is there a tag to get the parents url like {{entry.url}}?

Is there a tag that can shorten the following: {% set parentPage = entry.getParent() %} {% if parentPage %} <a href="{{ parentPage.url }}">{{ parentPage.title }}</a> {% endif %} ...