Questions tagged [url]

The tag has no usage guidance.

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

How to get an input value without refreshing with twig?

One way to read a dynamically inserted value is to refresh the page and get it in a twig variable through the url, something like this: {% set amount = craft.app.request.getQueryParam('amount') %} ...
1
vote
1answer
22 views

How to translate a structure url

I'm working on a multilingual website where I have one structure called Products. Currently, this structure's URI format is configured like this: {parent.uri ?? section.handle}/{slug} Which returns ...
1
vote
1answer
20 views

Site url is not generated correctly when using environment variables

I'm working on a multi-site setup (for a localized website). In my .env file, I have defined a SITE_BASE_URL variable. Then, in the control panel, I set up each site's base url with that environment ...
1
vote
1answer
30 views

Update 3.5.15.1 - Fixed a bug where the Updates utility wasn’t showing “Update” buttons

The update button is missing, and the fix is available, but impossible to initiate from the CP. Before I embark on a manual update, I wondered if there was a URL that I could use to trigger the ...
0
votes
0answers
34 views

Craft 3.x Menu : Entry URLs are set by the entry

I can't change the URL? How can I use a custom URL? Here is the link to the image: https://ibb.co/bz9BYnL
1
vote
1answer
124 views

Why is $DEFAULT_SITE_URL appearing in entries URL?

I have an entry loop on my homepage that uses {{ entry.url }} that links to the full entry. When I click on the entry, the url looks like this mydomain.com/$DEFAULT_SITE_URL/the-entrys-slug Even ...
1
vote
2answers
25 views

Conditional for specific page

I'd like to only load some scripts for 1 specific page with the Url /projects/. Currently I'm using: {% if craft.app.request.segments|first == 'projects' %} // load scripts {% endif %} This works. ...
1
vote
1answer
27 views

What is the different between url() and getUrl()

What is the different between url() and getUrl() Ex: {% set solutionIcon = solution.solutionIcon.one() ?? null %} <div class="img-wrapper mt--3 mb-2 mx-auto"> {% if ...
1
vote
1answer
24 views

Where can I set how the pagination links render?

I have inherited a Craft 3 project in which the pagination links render with a query parameter "page": https://mysite.com/blog/?page=2 but this makes crawlers like HREFS to ignore the Next ...
2
votes
2answers
155 views

How to get second last url segment

I'm setting up a dynamic thank-you page for all forms added to the site. Client can add forms with freeform to any page and I have set the return url to this: {{ form.renderTag({ class: "w-full ...
0
votes
0answers
54 views

404 Error for assets where “Base URL” and “File system path” are different

I am new to Craft 3 and I have seen similar questions asked many but never answered. I want to store my images in a directory that is not public, yet I want them to be served correctly by Craft. The ...
0
votes
0answers
15 views

entry / asset url integrity check

Is there any mechanism in Craft (or a plugin) which protects entries or assets from being deleted, if they are used in an asset / entry field used in an entrytype, global, ...? Or is there a way to ...
1
vote
1answer
246 views

How to get the hash/anchor in the URL?

I am using an entry's slug as the anchor for a page. How do I grab the anchor from the request? For example I want to get #article-one from /blog/#article-one If it's not possible, is there a way ...
1
vote
1answer
40 views

How can I retain entry category filtering on entry pages' pagination

I have a list of entries, with an option to filter them by categories. If no filter is applied, clicking an entry should (and does) take you to the permalink URL for that entry, as defined in the ...
1
vote
2answers
245 views

How to remove something from the slug/url

I got entries in the folder /cms/web/videos/ and the url display this: http://domainname.com/cms/web/videos/barco-auro. I want it to be this: http://domainname.com/videos/barco-auro. How do I create ...
1
vote
0answers
15 views

Section URI format deprecation error

I'm using the following URI format of a channel {slug}-{restaurant.one().slug}-{locations.last().slug}-{locations.one().slug} It throws a deprecation error caused by locations.last() however when I ...
2
votes
2answers
202 views

Change entries URL?

In ExpressionEngine was a URL field under the title field that was filled when writing the title. It was possible to change the URL to something else. Also if i want to change the title of an entry ...
1
vote
1answer
42 views

URL routing with types

We need to setup following URL: DOMAIN/{lang}/{family}/offers/{slug} e.g.: example.com/en/Larsen/offers/example What do we need to configure our section URL? Have anyone an idea?
1
vote
1answer
47 views

Migrating custom routes from v2 to v3

I have a handful of custom routes configured on this project like 'action/(?P<custom_id>[a-zA-Z][0-9]{6})/(?P<slug>.*)' => 'action/_member', If I'm reading the docs correctly, then ...
1
vote
0answers
132 views

How to get url from related entry in another site

I'm relating entries from another site in my installation, and I'm having issues getting the correct URL for the entry. This is an example of what I currently have: {% set carouselEntries = entry....
1
vote
1answer
68 views

How to load entries data in the General Configuration file?

I'm trying to set dynamic paths for values such as activateAccountSuccessPath. This kind of code below from my routes.php file works very well: use craft\elements\Entry; $myAccount = Entry::find()-&...
1
vote
1answer
41 views

How I’ll get an entryId based on a given URL?

I want to configure deeplinks for an app and want to set up 'universal links'. Right now I'll send an entry id to the element api to get the right content. But with universal links I didn't have a ...
1
vote
1answer
45 views

Filter by slug from URL (advanced)

Channel: Restaurants Channel: Nutrition / contains entries field named restaurant. Required URL format: restaurant-name-nutrition since the URL structure is merged I can't use getSegement(x) ...
2
votes
1answer
59 views

Entries field in categories URI

Is there a way to pass value of an entries field into category URI format? {% if object.level == 1 %} {slug}-{entries.one().slug} {% else %} {slug}-{parent.uri} {% endif %} Thanks.
1
vote
1answer
37 views

Using language specific variables inside section URL settings

When i use some kind of variable in url settings of section, it always uses default language version of this variable. For example, blog has two languages, english (default) and german. If i use ...
1
vote
3answers
469 views

How do I get rid of “web” in URL?

I have been all over the docs page and various other topics across the web on this, and nothing seems to solve it for me. It's probably something obvious, but I am stuck. I recently installed Craft 3 ...
1
vote
1answer
556 views

How do I get different URL Format with parent/child structures & how do I display different templates?

I need to create a features structure section for a website that will have parent features and child features. Q1: How do I get different URL Format for parent & child pages? I need the parent ...
1
vote
1answer
107 views

Query for entry related to current entry in section URI settings

My entries within specific section can be related to each other using "Entries" field. If entry1 "Entries" field is filled with entry2, i want to entry2 url look like this: entry1/entry2 How can ...
1
vote
2answers
73 views

Resolve url from inside template

Can I resolve full URL to some object - entry or category, from inside Twig template? Mind you, I don't mean searching for something by slug, but by full URL. So, for example, instead of passing '...
1
vote
0answers
47 views

Use sequential numbers for entry slug

I have a channel where I need each entry's URI include the year and then a sequential number, like this: 2018/1/ 2018/2/ 2018/3/ 2019/4/ I have no problem getting the year, but is there a way to get ...
1
vote
2answers
44 views

URL Structure - advise and thoughts of best approach?

I am currently building a website for Hot Tubs and within this there will be New Tubs, Used Tubs and Hire Tubs (each will be a top level page on the navigation, and each tub will have a details page). ...
1
vote
2answers
496 views

How can I use the entry UID in the entry URI

The entries in my Craft app need a unique ‘non-guessable’ URL, so I figured I could use the UID in the URI of the entry. So in the section, where I need to provide the URI format I entered "section-...
1
vote
1answer
91 views

Locales and links not working as intended

I have taken over a project and Im having a small problem with locales. It is running Craft 2.6.3016 A section has a locale “en” where the english URL format is “en/contact”, and the entry also have ...
1
vote
1answer
333 views

Element-API: Access the first url of an asset array

I have an asset field in my current project with the handle postImage, containing multiple image files. In my element-api endpoint, I wish to access the url of the first file only. I tried the ...
2
votes
1answer
2k views

Asset (image) public URL does not work

I wanted to include some uploaded assets (images) in an entry. The .url property in twig outputs the proper URL, in my case: http://localhost/craftcms/web/image/photo-2017-04-02-16-20-53-1.jpg ...
1
vote
0answers
27 views

Craft 3: Prevent craft adding script filename to URLS

I'm running Craft 3 with multi-site. Working well so far, but my hosting doesn't allow me to create traditional vhosts with their own directories and shared upper filesystem. As such I have an ...
2
votes
1answer
120 views

How to create clean URLs for category strings?

This code for linking to a category page: href="/products/?category={{ category.slug }}" Generates this URL: www.website.com/products/?category=category-name Can someone please tell me how to code ...
1
vote
1answer
333 views

How can I set a landing page for a structure with no slug?

In Craft2, I have structures that each have a landing page/homepage for that structure. If the structure's URI format is "liver/{slug}", how do I make the 'landing page' entry have a URI of only "...
1
vote
1answer
358 views

Point a plugin into to a local file

This should have been easy. But, I am dorking something up. I am trying to point FeedMe to a local file. In Finder, the file is located under /Users/shellyar/Desktop. I also tried `file:////Users/...
1
vote
2answers
251 views

Structure entry position in url

Is it possible to include the entry position (Structure) via the Entry Type Title Format? This is the current format: published in {postDate|date('F')} {postDate|date('Y')} which renders: published-...
2
votes
2answers
135 views

Change posts url without losing SEO positioning

I migrated a site with over 500 posts from Wordpress to Craft 2.6 recently but came across this problem: the WP site used to set post's urls as https://mysite.com/{slug} while the new blog is (...
0
votes
1answer
93 views

How can I use two different templates for a single entry?

I'm building a coursework site and have a Course section, who's entries will be courses containing work that the client will assign to users. I built in both the work itself (different "lessons" ...
1
vote
1answer
34 views

Adding multiple slashes after the site URL breaks the current entry, but still loads the template

I've come across an issue where typing the URL e.g www.sitename.com///about will still load the about template, but not fill the page with the content. Is this an issue for google finding the ...
1
vote
1answer
531 views

Get the section name based on a url segment

I'd like to retrieve the name of a section based on a url segment. Normally I would use {{entry.section.name}}, but this doesn't work, since there is no entry available. I've got this working: {% ...
1
vote
1answer
200 views

Include the URL of a related entry field

I would like to add the URL of the channel entry I have selected (atm 2 channels are available to choose from), so I would like a url like: summerhouses/product1 or greehnouses/product2 how would ...
1
vote
2answers
142 views

404 error if folder in public_html has same name as folder in craft/templates

I am currently transfering a live website to Craft CMS. I am trying to keep all URLs of pages and images exactly the same as the live version, because of all the pages and images cached in Google. ...
1
vote
1answer
90 views

How can I manually update the URI of an entry?

Is there a way to manually change the URI for an entry? for instance where is this stored in the database (is it?) I need to update one that is: /vacancies to /vacancies-1444 for example the 1444 ...
1
vote
1answer
99 views

Force Anchor ID into page URL

I'm trying to add tabs into my Craft Site and have just noticed that when you add an anchor point, the anchor ID doesn't actually show up in the URL as it would a normal site, however I need this ...
1
vote
1answer
215 views

How to make URLs translatable in Craft 3

I am trying to make the URLs translatable according to the language selected for the site.
1
vote
1answer
1k views

Craft 3 with Multi-Site: how to not set a primary site, or add a first segment to all primary site URLs?

I have a main domain, www.mycompany.com, which has several groups of sites, which are available in several languages: www.mycompany.com/international www.mycompany.com/sales/en www.mycompany.com/...

1
2 3 4 5 6