Questions tagged [uri]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
33 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, ...
0
votes
1answer
37 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: &...
0
votes
0answers
13 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 ...
0
votes
0answers
27 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....
0
votes
1answer
55 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-...
0
votes
1answer
12 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 %} ...
0
votes
1answer
36 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 ...
4
votes
3answers
177 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 ...
0
votes
0answers
12 views

Reading internal URLs with single backward slash instead of double (http:/ instead of http://)

Drupal is reading some internal links with single slash instead of double slashes. This is causing some pages to crash. I first noticed this when I edited a webform and saved. I checked the settings....
0
votes
1answer
43 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, ...
0
votes
0answers
39 views

Add to Cal: Parsing content to URL in Outlook add to calendar keeps the + signs used to replace spaces

Parsing content to URL in Outlook add to calendar keeps the + signs used to replace spaces in the Calendar still when Calendar is opened. Steps to reproduce From the front-end: Click Add to Calendar ...
3
votes
1answer
78 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 ...
0
votes
1answer
66 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 ...
1
vote
1answer
179 views

How do you get the current destination URL query parameter in Twig?

Does anyone know to how to get the drupal destination in twig file? At the moment I an getting the destination parameters in a preprocess function. // Get destination params. $variables['...
2
votes
2answers
182 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 ...
0
votes
2answers
86 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 ...
3
votes
2answers
147 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:...
0
votes
0answers
600 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 ...
2
votes
1answer
225 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 ...
0
votes
1answer
54 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 ...
3
votes
1answer
138 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::...
-5
votes
1answer
533 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&...
1
vote
1answer
491 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. ...
0
votes
1answer
157 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=...
0
votes
1answer
117 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 ...
0
votes
0answers
60 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 ...
1
vote
1answer
647 views

Notice: Trying to get property 'nid' of non-object

In Drupal\rsvplist\Form\RSVPForm->buildForm(), I wrote this to get the current nid: $node = \Drupal::routeMatch()->getParameter('node'); $nid = $node->nid->value; I get this error: ...
0
votes
0answers
46 views

Redirect user to a specific page

I'm new to drupal. And I have a project that has a search block on the home page that redirects the user to a page based on the user search terms. Everything works fine but I have a FAQ page that ...
0
votes
0answers
28 views

how to change the keyword for URL search with new search

I have a problem with the search API function. The first time I enter the keyword into the search field which will show the results and the URL like this for example: www.avc.com/avs/search/search-...
0
votes
1answer
45 views

Generate automatic URL alias removing words

I'm trying to create a topic page for "internet of things", but each time I create the page I notice the URL slug removes the word "of" in it. By default Generate automatic URL alias is checked. The ...
0
votes
1answer
43 views

How to print the URL of a title field?

I'm trying to print out the url path from the title in my twig template however I haven't been successful so far. Printing out the title containing the link works fine using: {{content.title}} ...
0
votes
1answer
457 views

Custom Page routing

I created a custom page type called 'Angular page' and a custom twig template for it which loads my angular scripts and prints the <app-root> tag. I set the page URL to /angularpage and the ...
0
votes
1answer
621 views

Programmatically auto-submit a Webform after visiting its URL

I am wondering whether it's possible to programmatically auto-submit a Webform after visiting its URL and to save the user from a 'submit' button click. The below webform can be accessed via /form/my-...
0
votes
0answers
188 views

How to redirect to the previous page after submission of a form in a block

I have a view of nodes of type task. I created a block with an inline task create form (using form block module) The block is next to the view on the same page. Question: After creating a new task by ...
0
votes
1answer
582 views

Get Absolute url using hook_preprocess_node

We are attempting to change the $variables['url'] from a relative to absolute URL within the mymodule_preprocess_node() hook. The $variables['url'] is displayed as a <a> element within our node--...
0
votes
1answer
91 views

Get 404 for url specified in module.routing.yml

I am new to Drupal and I got stuck with the problem that I don't know how to debug even: I have made a simple module 'final', its structure: Applications/MAMP/htdocs/drupal_dir_1/modules/final > ...
3
votes
2answers
3k views

Get raw and relative path of a file uri

I have a file with an uri and I want to get its raw and relative path. Uri: public://videos/Test Video.mp4 Path: /sites/default/files/videos/Test Video.mp4 I found already a way to do this: $...
2
votes
1answer
1k views

Pass parameter to node twig template via url

The url to display node 100 is <site>/node/100. I want to pass a parameter to this node via the url. For example: <site>/node/100/3. Question: What must I do to get Drupal 8 to see /node/...
0
votes
1answer
734 views

How to output multiple files url entities on twig?

I have a file entity field that I can upload multiple files and I'm trying to render or display it inside my node twig template. The code below is what I'm trying to make it display. Tried clearing my ...
0
votes
1answer
28 views

Can I change an upload URL to match the original upload?

I uploaded a PDF in Dupal and used the URL created. Somehow, that document wasn’t saved or was deleted, so now that URL (which is being promoted widely) leads to a page not found. I uploaded a new ...
0
votes
2answers
196 views

How do I remove the term ID from the view URL?

I have a content view with an exposed filter based on a vocabulary. In the URL (for example, mysite/myview?tid=taxonomy+term+(3)), and incidentally in my page title (I use argument.tid to display a ...
2
votes
1answer
530 views

Why is the --uri option needed to return absolute URLs?

I want to execute a View and export the JSON file to the files directory. I am using Views Data Export and VDE drush add-on modules. My view has a file/PDF field and I want to provide a direct link to ...
-1
votes
1answer
71 views

Getting redirect to phantom page /user/register/thankyou

In Drupal 8, I created a page with the path alias /user/register/thankyou to redirect users to after registration. Later, I changed the url of this page to simply be /register/user/thankyou. I have ...
2
votes
1answer
585 views

Convert node URL to absolute

We are using Drupal Core v8.6.2 and we have a url variable in our node--page.html.twig template. While using ksm() and {{ kint() }} we are finding that if we use hook_preproces_node($variables) that ...
0
votes
1answer
794 views

Multiple URLs for same node

anyone know how to create a URL alias and not redirect the user? I have a node with its alias set to /sign-up, but I also want it accessible via /caregiver/sign-up. I created a URL alias, but it seems ...
1
vote
1answer
46 views

How to display the user's url in a template?

I created a template user-comment.html.twig to customize the rendering of the comments author. I can not display the user account url: user.url does not work. How to display the user's url in a ...
1
vote
1answer
91 views

How to display the path without alias?

With Drupal 8 and Commerce 2.10 I created a php code to display the link of my store. When I go to the link, it displays: https://www.domaine.com/shop/name I want to display without alias: https:/...
0
votes
1answer
522 views

Views Link Display Settings Is Not Accepting External URL

I want to add an external URL to the Views More Link Display Settings. It is also mentioned in the guide lines as well ("A Drupal path or external URL the more link will point to. Note that this will ...
2
votes
1answer
425 views

how rewrite pagination URL views for SEO?

i am trying to rewrite the views url pagination : /mypath/cat?page=1 to /mypath/cat/1 or > /mypath/cat/page/1 or /mypath/cat-1 cat is a taxonomy term. I have tried to rewrite url with Drupal\...
0
votes
1answer
51 views

Can't clean URL from custom query parameters

I have a client whose company has different branches. The data are retrieved from a DB (not the Drupal one). For example, the url mydrupalsite.com/branch?branchID=1 should lead to mydrupalsite.com/...

1
2 3 4 5
23