Created
November 3, 2017 18:19
-
-
Save cristiroma/675ea0a52cae2a2476d8e9e7515e37bc to your computer and use it in GitHub Desktop.
An SQL query to URL to all published web pages (nodes) in a Drupal installation from url_alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select concat('http://your.website.url/', c.langcode, c.alias) url from node a | |
inner join node_field_data b on a.nid = b.nid | |
inner join url_alias c on CONCAT('/node/', a.nid) = c.source AND c.langcode = 'en' | |
where b.status = 1 group by a.nid | |
UNION | |
select concat('http://your.website.url/', c.langcode, c.alias) url from node a | |
inner join node_field_data b on a.nid = b.nid | |
inner join url_alias c on CONCAT('/node/', a.nid) = c.source AND c.langcode = 'fr' | |
where b.status = 1 group by a.nid | |
UNION | |
select concat('http://your.website.url/', c.langcode, c.alias) url from node a | |
inner join node_field_data b on a.nid = b.nid | |
inner join url_alias c on CONCAT('/node/', a.nid) = c.source AND c.langcode = 'es' | |
where b.status = 1 group by a.nid | |
ORDER BY url; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment