Search Results
… I'm always searching for this information when I need to print out a URL or find the current page path. The difficulty is that finding or printing out a URL is very contextual and there is more than one way to get or use … there is very little documentation on drupal.org about this. Creating URLs and printing out links is perhaps the most common thing that needs …
… share content through the use of an API. This allows users to share a URL for a web page and see a representation of that page embedded in … the providers.json registry. { "provider_name": "Twitter", "provider_url": "http://www.twitter.com/", "endpoints": [ { "schemes": [ … "https://*.twitter.com/*/status/*" ], "url": "https://publish.twitter.com/oembed" } ] } Using this information …
… pointing to a page, and this can be created easily using a Drupal\Core\Url object. $url = Url::fromRoute('entity.node.canonical', ['node' => 1]); return new …
… location then you would use drupal_realpath(), whereas if you want a URL of the file you would use file_create_url(). For example, the a file called test.png in the public file … , this would be translated in the following ways by the file_create_url() and drupal_realpath() functions. $url = …
… was by appending the hash value like "#node/123" to the end of the URL. This meant that as the page loaded I could look for this hash … will append the path of the link that was clicked to the end of the URL as a hash value. // Find all modal links on the page and attach a … // When the link is clicked, add the path to the URL as a hash value. history.pushState('', '', `#${this.pathname}`); …
… sent a request. This controls how Varnish deals with cookies and which URL's should be included or excluded from the cache mechanisms. This is … of the IP address of the user to the server in a proxy header. What URLs to skip when storing cache objects. Optionally prevent access to … = 6h; # Pipe these paths directly to Apache for streaming. if (req.url ~ "^/admin/content/backup_migrate/export") { return (pipe); } # Set …
Article: Drupal 9: Creating A GET Form
… from how you get data from the form input to considerations of the URL structure is important. In fact, I would say that creating GET … swapping to a GET form is that the the form data will be added to the URL (which is how GET requests work). This means that any data the user entered will be added to the URL of the page. Additionally, because Drupal adds additional elements …
… httpClient property. public function returnGetPage() { // Generate the Url object for the page we want to get. $url = new Url('entity.node.canonical', ['node' => 123]); // Make the call to the …
Article: Drupal 9: Creating Ajax Dialogs
… { $output = []; $output['a_dialog_link'] = [ '#type' => 'link', '#url' => new Url('mymodule_display_modal'), '#title' => 'node in dialog', … { $output = []; $output['a_dialog_link'] = [ '#type' => 'link', '#url' => new Url('mymodule_display_modal'), '#title' => 'node in …
… = { attach: function attach(context, settings) { $.ajax({ url: Drupal.url('loading/ajax'), type: 'POST', contentType: 'application/json; … = NULL; // Create the batch_process(), and feed it a URL that it will go to. $url = Url::fromRoute('user.page'); $response = …