Questions tagged [uri]

A "Uniform Resource Idendifier" identifies a resource on a network.

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

why is index.php added to URLs?

Since I updated my site to Drupal 9.5.11, 'index.php/' is added to every URL: http://mysite.org/index.php/ for the home page, for example. On some page, I have a list with links to files and, because ...
gbmapo's user avatar
  • 1,066
1 vote
0 answers
24 views

How do I prevent the language code being stripped from the URL pathway?

Problem When trying to link to example.org/fr/node/1, links directs to example.org/node/1. Same problem when using direct pathways instead of node links. Trying to link to example.org/fr/a-propos/...
Harvey Johnson's user avatar
1 vote
1 answer
74 views

Why do routes created in a React router that do not exist in Drupal give a 404 when I reload the browser?

I have a Drupal 10 site with one page at the following URL: localhost:9090/my-page. On that page, I have a Drupal block that includes a React app with its own Browser Router. React BrowserRouter ...
Marko Savic's user avatar
1 vote
0 answers
12 views

How to send webform's full URL to Salesforce

We are creating Leads in Salesforce from Webforms submissions and now we want to include the full URL in a Salesforce field. I have tried Submission URI field but it does not include the host nor the ...
Khin's user avatar
  • 11
0 votes
1 answer
73 views

Website doesn't load properly from htdocs/web

Built a website on localhost, moved it to shared-hosting where webroot is htdocs but when visiting the website through the hosting's given IP address it obviously doesn't load the website, because the ...
user3108268's user avatar
-3 votes
2 answers
45 views

Using custom scheme (myapp://dashboard) in drupal simple-oauth2 module's redirect url

How can I use custom scheme i.e. myapp://dashboard for the redirect field of Drupal simple oauth2 module? I get this error: 'myapp://dashboard is not a valid url' I also tried to use the redirect ...
Tejas's user avatar
  • 1
0 votes
0 answers
27 views

JsonAPI does not work with "and" and "or" group

A website search accesses http://api.example.com/de/jsonapi/node/product. The current fetch request looks like this. http://api.example.com/de/jsonapi/node/product ?filter[or-group][group][conjunction]...
jaykobo's user avatar
1 vote
1 answer
39 views

How do I parse a path alias? [closed]

I have the following code in my page.tpl.php file. <?php $path = drupal_get_path_alias($_GET['q']); ?> <?php if ($path == 'about-us'): ?> <div class="container"> <...
CJ Catalano's user avatar
2 votes
1 answer
247 views

How can I change the query string used in pages showing search results from keys=football to keyword=football?

Search results are given in a page whose URL is, for example, https://example.com/search/node?keys=football. This URL is not recognized by Google Analytics as a search result URL. How can I change the ...
Juc1's user avatar
  • 369
-3 votes
1 answer
183 views

How to open an iframe with a different base URL for "Page Not Found" errors in Drupal?

I am working on a Drupal website and I need to implement a functionality where an iframe is opened with a different base URL whenever a "Page Not Found" error occurs. The goal is to display ...
Rayan Frem's user avatar
0 votes
1 answer
40 views

Export product image with Commerce Cart API module

I'm usng the "Commerce Cart API" module on my website to build a custom cart js layer. The problem i am facing is the purchased entity has a field_image field and I would like get the url of ...
Mariano Banchio's user avatar
0 votes
0 answers
31 views

How can I make <img> include the host?

We have a form with CKEditor where a user can compose a news item. When set to 'basic HTML' input, the user can upload an image to insert as part of their input. Later, I need to get this node body ...
VardeVim's user avatar
2 votes
1 answer
441 views

How to get webform url object, if I have webform machine name and webform path

I have webform path and webform machine name, how can I get url object of this webform?
EvilArgest's user avatar
2 votes
1 answer
89 views

Can I know what I'm looking at from the URL?

I think on Drupal 7 I had previously used something like menu_get_object() to find out what content I was on. For example, with mysite.com/content/my-page, it would tell me that this was a node, its ...
Andrew Morris's user avatar
0 votes
1 answer
797 views

Get an entity URL, not its path alias

How can I get the URL of an entity without its alias? This code just gives me the path alias, but what I actually want would be, for example, /en/node/1 instead of /en/node/my-title. $entity->toUrl(...
Sebastian's user avatar
  • 635
0 votes
1 answer
108 views

How do I unset a link?

I want to programmatically decide whether to render a link or not. This should apply to all links e.g anchor tags (no wysywigs) Not only menu links. I tried using hook_link_alter. /** * Implements ...
john Smith's user avatar
0 votes
1 answer
117 views

How to add the domain to the Link field?

I activated the Link module that is part of Drupal core. I want to add on the user profiles fields with links to social pages and limit the domain used in the link. How can I add such restriction to ...
zoulou66's user avatar
0 votes
1 answer
103 views

Linkit Module - Pointing the link's title attribute to a custom field. Hook available? [closed]

Currently the Linkit module delivers the link's title attribute by pulling the related node's title field. We would like it to point to another field in the node. How can we achieve this? I looked ...
MastaP's user avatar
  • 152
1 vote
2 answers
319 views

How to apply nofollow and target_blank on external links in text created with CKEditor?

When I create a node, I often need to add links to external websites in the text. I want all the external links to open in a new tab and I want them to have a nofollow. The body field uses CKEditor. ...
zoulou66's user avatar
0 votes
0 answers
30 views

How to add contextual filter?

I am working with books in drupal 8. I want to display a specific page("table of contenets") on the sidebar whenever any page of that book is accessed. "table of contents" is a ...
Steve Siddu's user avatar
1 vote
0 answers
33 views

Filter GeoJSON feed on a value in the path

I have GeoJSON feed, created with a view in Drupal 7, that I want to filter on a path value in the url of the loaded page (/path/%). The feed is loaded as an Openlayers map on a page. The feed seem to ...
frank.schram's user avatar
0 votes
1 answer
303 views

How to get the base URL of a site in Queue API?

I am trying to get the base url of the drupal 8 website in a queue process but I am getting http://default as the base url. What am I missing here? public function testUrl() { global $base_url; ...
Sudheesh S Babu's user avatar
0 votes
1 answer
370 views

Gracefully handle URL/URI/Link exceptions when using Link field formatter?

Occasionally I am encountering an error along these lines: The website encountered an unexpected error. Please try again later.InvalidArgumentException: The URI 'XYZ' is invalid. You must use a valid ...
Kevin's user avatar
  • 27.7k
1 vote
1 answer
356 views

How to get product variation media file url using jsonapi?

I'm using the following jsonapi GET request to retrieve product variations for a product: /jsonapi/commerce_product/default/0ea927c7-b62d-45c9-8bec-dc3d16215276/variations?include=field_images ...
iamfredrik's user avatar
-5 votes
1 answer
505 views

Why does a query string return a 404 error? [closed]

I recently upgraded from Drupal 8 to Drupal 9 and noticed a problem that occurs when the URL has a query string. For example for the following URL Drupal throws a 404 page not found. https://example....
Matt's user avatar
  • 37
0 votes
1 answer
217 views

How can I disable these URLs?

In Drupal 7, the following URLs show the same node. http://www.example.com/node/5 http://www.example.com/node/5/randomtext1 http://www.example.com/node/5/randomtext2 http://www.example.com/node/5/...
Dimetry's user avatar
  • 430
0 votes
1 answer
229 views

How do I hide static media file URLs?

I have developed a website in Drupal 7. Right now I have a requirement: A page should display a PDF file (already generated). Only authenticated users should have access to view or download this file, ...
mayur3868's user avatar
0 votes
1 answer
403 views

How can I create a Link to an URL containing a fragment identifier?

Is it possible to create a Link to a node with a hash in url (for opening a special Tab). I use: Link::createFromRoute('Title', 'entity.node.canonical', ['node' => 77]); And I want to link to: &...
tis's user avatar
  • 75
0 votes
2 answers
175 views

How to prevent proxy URLs in link field from being encoded?

Others appear to have similar issues to Drupal 8/9 encoding URLs in the link field though I see no solutions. We're a library site and have many links for our patrons to external database websites ...
Kevin S's user avatar
0 votes
0 answers
656 views

How to get the URL of remote video inserted by media field in block or paragraph twig?

How to get the URL of remote video inserted by media field in block or paragraph twig? I am using the paragraphs module to create video galleries from youtube videos. When I use {{ content....
Shakil Ahmad's user avatar
0 votes
2 answers
777 views

Drupal and reverse proxy: How to make Drupal aware that it's protocol is HTTPS?

I have a reverse proxy Docker container in front a Drupal container on a Docker host. My reverse proxy container is https://hub.docker.com/r/jwilder/nginx-proxy The public site URL is https://ahora-...
alberto56's user avatar
  • 214
0 votes
1 answer
197 views

Find a URL inside Twig file from content made from another content type (referenced/ has a relationship)

I'm new to Drupal, and have stumbled across this issue. I have entries (entry) that are blogs held inside a blog_listing. E.g. {% for entry in content.field_blog_listing_entries|field_target_entity %} ...
yahms23's user avatar
  • 101
0 votes
1 answer
257 views

How do I get the current URL in a rule?

I am trying to make a Rule where after the user logs in they are redirected to the front page except when they are setting their first time password or resetting their password To do it I want to use ...
Eluchel's user avatar
  • 329
5 votes
3 answers
1k views

How can I restrict external URLs in link field to allow only certain domains?

After creating a Link field and use the Link with service icon format, I find out that there is no option to restrict external URLs to external domains that I want For example, if I only want to allow ...
MrIssue's user avatar
  • 75
0 votes
1 answer
1k views

How do I get the public file URI for a media file from jsonapi?

I have an audio file that is stored as Media of type Audio. Now I want to get the link to that file that is usually displayed to site users via jsonapi. For example, when the media entity is rendered, ...
Patrick Kenny's user avatar
3 votes
1 answer
368 views

How to get the destination nid from an URL object

In a preprocess function I want to access the destination node id via the URL object I cannot find any method that will return the node id for me but I can clearly see that it holds the node id. (see ...
supersize's user avatar
  • 263
0 votes
1 answer
209 views

How do I prevent node enumeration?

I am currently developing a Drupal 8 site that will consist of one only central content type with a minimal menu structure. The user is supposed to navigate the site only by using a search/filter form ...
Marcus C.'s user avatar
  • 289
2 votes
2 answers
3k views

How do I get the current destination URL query parameter?

Does anyone know to how to get the destination in a template file? At the moment I an getting the destination parameters in a preprocess function. // Get destination params. $variables['...
Joshua Graham's user avatar
2 votes
2 answers
1k views

How to dynamically manipulate canonical entity URLs

I've got a project with a multi-user / multi-domain environment. There is one "main" portal like www.myproject.com and for every registered user with a specific custom permission ...
Hudri's user avatar
  • 5,286
0 votes
2 answers
1k views

Use url of media field in view twig

I need to output the url for field_slide_media in views-view-unformatted--carousel.html.twig. I can output the entity ID using: {{ view.field.field_slide_media.value(view.result[i]) }} I would like ...
MrFox's user avatar
  • 137
3 votes
2 answers
794 views

What is the best practice for writing a link to the screen through t()?

In Drupal 7, one could do the following one line:: t('Visit !mylink', ['!mylink' => l('my website', 'http://example.com')]); But that no longer works in Drupal 8 or 9 😞. So far, I've tried this:...
Free Radical's user avatar
  • 15.1k
0 votes
0 answers
2k views

Programmatically get the current url of the page from where a Webform in a dialog has been loaded

The below link will open the webform (contact) in a dialog: <a href="/form/contact" class="btn btn-success webform-dialog webform-dialog-normal">Contact</a> this same link has been ...
user avatar
2 votes
1 answer
693 views

$base_root problem

In /core/lib/Drupal/Core/DrupalKernal.php the $base_root shows incorrect value: Line 1113 protected function initializeRequestGlobals(Request $request) { global $base_url; // Set and ...
Charles Letcher's user avatar
0 votes
1 answer
221 views

Alter a path alias depending on a node property

I use the Pathauto module and I'm trying to get, for the same content type, two different path aliases depending on a Boolean field that content type has. I would like to have a path alias like ...
Fizzz69's user avatar
3 votes
1 answer
321 views

When should I use the Url::fromRoute method instead of "new Url"

I'm finding that these two PHP snippets yield the same result: $arr['query']['confirm'] = 'y'; $text = t('Click here.'); $url = new Url('my_route.import', [], $arr); // Three arguments. $link = Link::...
arnoldbird's user avatar
  • 1,079
-4 votes
1 answer
2k views

How to link to a file in twig template

I'm trying to link to a file in a view. I have a field in the view that outputs the link if I use it like this: <div class="product-cta-view-pdf"> {{ fields.field_notice.content }} </div&...
FonsVC's user avatar
  • 111
1 vote
1 answer
1k views

Render media url in node--page.html.twig

I have an Entity reference field field_video. It's a core Media field with a Reference type of Remote video. Because I use this field_video in my Hero section I need some additional markup here. ...
meez's user avatar
  • 1,333
0 votes
1 answer
2k views

Get argument from current URL in twig to generate a link with that argument

I'm trying to get an argument from search page URL so that I can pass that argument to a link. For example I have this URL for a search results page: http://domain.com/site-search?search_api_fulltext=...
fallenturtle's user avatar
0 votes
1 answer
261 views

How to create programmatically multiple URL alias of same taxonomy term?

I have category cars and I want to create its URL alias according to the region like if the user location is Australia than URL will mysite/australia/cars similar if the user location is USA than URL ...
Adi's user avatar
  • 3,211
0 votes
0 answers
145 views

Ckeditor pasted url links become hyperlinks

We have disabled 'Convert URLs into links'. When you copy a url link from a browser url field like: drupal.org. Your clipboard contains the FQDN: https://www.drupal.org/. When you past this into ...
paul cappucci's user avatar

1
2 3 4 5
23