Saturday, November 28, 2020

Get The PNG extension form in drupal 8 sql querys

The structure of the file should be:

Image URL, Node Title, Node Edit Link


 

Node types image fields

field_image

Select file.filename, image.entity_id, node_data.title  from node__field_image as image

JOIN file_managed as file ON file.fid = image.field_image_target_id 

JOIN node_field_data as node_data ON node_data.nid = image.entity_id

where file.filename like "%.png%"


field_cover_image

Select file.filename, node_data.title, image.entity_id from node__field_cover_image as image

JOIN file_managed as file ON file.fid = image.field_cover_image_target_id 

JOIN node_field_data as node_data ON node_data.nid = image.entity_id

where file.filename like "%.png%"


field_image_browser

Select file.filename, node_data.title, image.entity_id from node__field_image_browser as image

JOIN file_managed as file ON file.fid = image.field_image_browser_target_id 

JOIN node_field_data as node_data ON node_data.nid = image.entity_id

where file.filename like "%.png%"


field_image_sample

Select file.filename, node_data.title, image.entity_id from node__field_image_sample as image

JOIN file_managed as file ON file.fid = image.field_image_sample_target_id 

JOIN node_field_data as node_data ON node_data.nid = image.entity_id

where file.filename like "%.png%"


field_finishes

Select file.filename, node_data.title, image.entity_id from node__field_finishes as image

JOIN file_managed as file ON file.fid = image.field_finishes_target_id 

JOIN node_field_data as node_data ON node_data.nid = image.entity_id

where file.filename like "%.png%"


field_images

Select file.filename, node_data.title, image.entity_id from node__field_images as image

JOIN file_managed as file ON file.fid = image.field_images_target_id 

JOIN node_field_data as node_data ON node_data.nid = image.entity_id

where file.filename like "%.png%"


field_teaser_image

Select file.filename, node_data.title, image.entity_id from node__field_teaser_image as image

JOIN file_managed as file ON file.fid = image.field_teaser_image_target_id 

JOIN node_field_data as node_data ON node_data.nid = image.entity_id

where file.filename like "%.png%"


field_detail_image

Select file.filename, node_data.title, image.entity_id from node__field_detail_image as image

JOIN file_managed as file ON file.fid = image.field_detail_image_target_id 

JOIN node_field_data as node_data ON node_data.nid = image.entity_id

where file.filename like "%.png%"


Paragraph types

field_gallery_image

Select file.filename, node_data.title, node_data.nid from paragraph__field_gallery_image as image

JOIN file_managed as file ON file.fid = image.field_gallery_image_target_id

JOIN paragraphs_item_field_data as paragraph ON paragraph.id = image.entity_id

JOIN node_field_data as node_data ON node_data.nid = paragraph.parent_id

where file.filename like "%.png%"



field_image

Select file.filename, node_data.title, node_data.nid from paragraph__field_image as image

JOIN file_managed as file ON file.fid = image.field_image_target_id

JOIN paragraphs_item_field_data as paragraph ON paragraph.id = image.entity_id

JOIN node_field_data as node_data ON node_data.nid = paragraph.parent_id

where file.filename like "%.png%"

No comments:

Post a Comment

If you have any problem please let me know.