Questions tagged [url]

The tag has no usage guidance.

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

DOM hash url in entry slug

I try to set the slug of an entry to a url using a hash. https://url.spec.whatwg.org/#dom-url-hash However it seems not possible by default, craftcms changes the hash to a dash. I need that as ...
1
vote
2answers
25 views

Make page urls correspond to their structure

I set up a page entry type under Structures, and because this is for generic pages, I want it to be arbitrarily nestable. From the structure page, this is easy to set up; however, I want the urls for ...
1
vote
1answer
311 views

dynamic urls for channel/structure that's linked to the main structure

I'm trying to create dynamic urls for a channel or structure section that depend upon the url structure of a different structure (or the first entry in that structure). For example, if the main ...
0
votes
0answers
20 views

Remove ID in URL

is it possible to remove ID in post URL : https://www.example.com/example/example-2/exampleexample-2464942 I mean "2464942". Thanks everyone !
1
vote
1answer
299 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
2answers
46 views

Craft's case-insensitive routing

I was just surprised when I noticed, that our Craft installation is not case sensitive with routing: E.g. https://domain.com/route/to/page-with-content delivers the same content as https://domain.com/...
0
votes
0answers
39 views

Craft not using correct URL on Entries' list link button

I'm using Craft as a headless CMS and when I click on the entry link at the entries' list it uses the Craft Server URL instead of the correct frontend URL (See images). For example: https://craft-...
1
vote
1answer
34 views

How many different URLs in a project

We are currently evaluating different cookie consent solutions considering its price models and therefore we need to know the amount of "active" URLs in our Craft multisite installation. ...
1
vote
1answer
85 views

how to get request url?

I'm trying to get url from request, {{ craft.app.request.url }} but the uri is chinese, like "localhost/測試", it print out "http://localhost/����" did i miss some setting in craft ...
1
vote
1answer
24 views

What's the best strategy for products that are sold?

I wonder what's best practice for products that are sold? My strategy is to add a lightswitch "sold" and don't display sold products on the website and in the sitemap.xml, in the hopes that ...
1
vote
1answer
27 views

Using a language cookie with Craft

I work on a large, complex site that uses a cookie banner to store a language cookie. We have 11 different languages on the site. We use craft for only one part of our site, with our base URL for ...
1
vote
1answer
74 views

Siteurl - craft.app.request.absoluteUrl() output missing "www"

How can I add "www" to the output of {{ craft.app.request.absoluteUrl }}? In my .env file I have DEFAULT_SITE_URL="https://www.mysite.com" but {{ craft.app.request.absoluteUrl() }}...
4
votes
1answer
7k views

How do I properly set assets paths?

I'm having a problem getting my asset URLs to print properly in templates. The site is using a multi-environment configuration (dev/stage/live) with localized content (en/es/da) and shared assets. ...
1
vote
2answers
494 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 ...
0
votes
0answers
39 views

All URLs changed path after upgrading to 3.6?

I'm not sure exactly what has changed here. All links are directing to "site.test/admin/site.test/blog/{slug}", when clicking on the link from the entry page. Before they would be "site....
1
vote
1answer
71 views

Get image asset relative url

I'm using image transforms and getUrl() method to display an image. I'm using Blitz to export my site as a static website. My problem is that .html pages get cached with images that have full urls ...
0
votes
0answers
12 views

Force expiration of particular token

We've had software crawl our site to find SEO issues. The crawl has found every URL twice, once with a token, once without. Each of the URLs with the token is displaying the same, and with the URL-...
0
votes
0answers
38 views

Url Helper does not create a usable url

When I create a cpUrl like that: UrlHelper::cpUrl($this->entry->cpEditUrl) I get something like that: https://hegi.test/admin/entries/article/7707-test But that don't work inside of the browser. ...
1
vote
1answer
32 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
2answers
152 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') %} ...
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
45 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 ...
2
votes
1answer
232 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
49 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
39 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
2
votes
1answer
391 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
75 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
44 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
53 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
3k views

If page conditions

I have an {% include%} which displays entries from a structure. This {% include%} is displayed on the homepage and other entries throughout the site. On the homepage, I'd like the include to show a ...
2
votes
2answers
661 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
81 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 ...
1
vote
1answer
72 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 ...
2
votes
1answer
1k 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 ...
2
votes
1answer
723 views

Problem with Site Running Both HTTP & HTTPs

So we're trying to set-up a site to run both HTTP & HTTPs version in parallel for SEO auditing before making the full switch to HTTPs. We followed Ben's answer on this SE question to make it work: ...
13
votes
5answers
7k views

Image transforms returning cpresources url

I'm trying to get Craft to render an image transform defined in the control panel. No image is added to the "filelocation/_transformhandle" folder and returns the url "/cpresources/transforms/98" ...
1
vote
1answer
49 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
2answers
425 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
19 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
415 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 ...
3
votes
2answers
2k views

Using pagination on a page with url with query string data

I have an index page that filters entries based on url query strings, eg: site.com/inductees?county=123. I put together a very simple pagination setup with next/prev links. However, when I click "...
1
vote
1answer
44 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
0answers
180 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
90 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
54 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 ...
32
votes
1answer
11k views

What’s the recommended way to set the site URL?

There are multiple ways to set the site URL. What is the recommended way?
1
vote
1answer
62 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
3k 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 ...
2
votes
1answer
92 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
43 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
2 3 4 5 6