- Issue created by @Ammar_Arman
- Merge request !21Issue #3464179 by Ammar_Jeetawi: Add a fallback URL for node social media tokens when the media field is empty β (Merged) created by Unnamed author
-
Rajab Natshah β
committed 3854f0cc on 10.0.x authored by
Ammar_Jeetawi β
Issue #3464179 by Ammar_Jeetawi: Add a fallback URL for node social...
-
Rajab Natshah β
committed 3854f0cc on 10.0.x authored by
Ammar_Jeetawi β
- Status changed to Needs review
4 months ago 10:34am 28 July 2024 -
Rajab Natshah β
committed ca840b5f on 10.0.x
Issue #3464179 by Ammar_Jeetawi, Rajab Natshah: Add a fallback URL for...
-
Rajab Natshah β
committed ca840b5f on 10.0.x
- Status changed to Needs work
4 months ago 12:29pm 28 July 2024 - π―π΄Jordan Rajab Natshah Jordan
Needs to find a token replacement when the media is data is empty
-
Rajab Natshah β
committed e08d9c71 on 10.0.x
Issue #3464179 by Ammar_Jeetawi, Rajab Natshah: Add a fallback URL for...
-
Rajab Natshah β
committed e08d9c71 on 10.0.x
- π―π΄Jordan Rajab Natshah Jordan
- Check if a media field in a node is empty and return a fallback URL if it is.
- Change the logic to
Implements hook_token_info()
- Change our logic on the used tokens with tokens info
Our past tokens are
[node:field_media:entity:social_large]
[node:field_media:entity:social_medium]
[node:field_media:entity:social_small]
They are to complicated to use.
and the nesting is not allowing us to have a fullback in the right way
Get the social share image for the node ( Smart token )
[node:share-image]
Check if the field media has data, then bring itβs image (social_large
) size
else the fullback share image from the active theme.[node:share-image:field_image]
Check if the field image has data, then bring itβs image (social_large
) size
else the fullback share image from the active theme.[node:share-image:field_media]
Check if the field media has data, then bring itβs image ( any selected field_ entity reference to media ) (social_large
) size
else the fullback share image from the active theme.[node:share-image:field_media:social_large]
Check if the field media has data, then bring itβs image ( any selected field_ entity reference to media )social_large
size
else the fullback share image from the active theme.[node:share-image:field_media:social_medium]
Check if the field media has data, then bring itβs image ( any selected field_ entity reference to media )social_medium
else the fullback share image from the active theme.[node:share-image:field_media:social_small]
Check if the field media has data, then bring itβs image ( any selected field_ entity reference to media )social_small
else the fullback share image from the active theme. - Merge request !22Issue #3464179 by Ammar_Jeetawi: Add a fallback URL for node social media tokens when the media field is empty β (Merged) created by Unnamed author
-
Rajab Natshah β
committed 52a858b6 on 10.0.x authored by
Ammar_Jeetawi β
Issue #3464179 by Ammar_Jeetawi: Add a fallback URL for node social...
-
Rajab Natshah β
committed 52a858b6 on 10.0.x authored by
Ammar_Jeetawi β
- π―π΄Jordan Rajab Natshah Jordan
After a full testing round.
The smart token logic is not working in many cases.Get the social share image for the node ( Smart token )
[node:share-image]
Check if the field media has data, then bring itβs image ( social_large ) size
else the fullback share image from the active theme.-- this should work with field_media
if no field_media, check for a field_image
if no field_video.. get the fallback share-image from the theme - Merge request !24Issue #3464179 by ammar_jeetawi: Add a fallback URL for node social media tokens when the media field is empty β (Merged) created by Unnamed author
-
rajab natshah β
committed 843b4138 on 10.0.x authored by
ammar_jeetawi β
Issue #3464179 by ammar_jeetawi: Add a fallback URL for node social...
-
rajab natshah β
committed 843b4138 on 10.0.x authored by
ammar_jeetawi β
- Status changed to Active
3 months ago 3:57pm 17 August 2024 - Merge request !26Issue #3464179: Pass the style to default token share image β (Merged) created by Unnamed author
-
rajab natshah β
committed 70f6b6da on 10.0.x authored by
ammar_jeetawi β
Issue #3464179: Pass the style to default token share image
-
rajab natshah β
committed 70f6b6da on 10.0.x authored by
ammar_jeetawi β
- Status changed to Needs review
3 months ago 9:16am 20 August 2024 -
rajab natshah β
committed 611293d9 on 10.0.x
Issue #3464179: Add a smart [node:share-image] token with option for a...
-
rajab natshah β
committed 611293d9 on 10.0.x
- Status changed to Fixed
3 months ago 4:39pm 22 August 2024 - π―π΄Jordan Rajab Natshah Jordan
Testing cases for this task using https://metatags.io
Content type: Varbase Blog
Media fields:field_media
Test Blog post - Remote Video - With cover image β
Test Blog post - Remote Video - No cover image β
Test Blog post - Local Video - With cover image β
Test Blog post - Local Video - No cover image β
Test Blog post - Image β
Test Blog post - No image βContent type: Post
Media fields:field_image
Test Post - image β
Test Post - No image βContent type: Post
Media fields:field_video
Test Episode - Remote Video - with cover image β
Test Episode - Remote Video - no cover image β
Test Episode - Local Video - with cover image β
Test Episode - Local Video - no cover image β
Test Episode - No video βContent type: Show
Media fields:field_video
andfield_video
for Varbase Media Header
Show - No video - No media header data β
Show - Local Video - With cover Image - No media header data β
Show - Local Video - With cover Image - with media header (Image) β
Show - Local Video - No cover Image - with media header (Image) β
Show - No Video - with media header (Image) βContent type: Landing page (Layout Builder)
Media fields: N/A
Test Landing page (Layout Builder) - No image βContent type: Basic page
Media fields: N/A
Test Basic page - No image ββ Have the default Drupal core icon.
Could be improved in other issues by adding a fallback image local videos or changing the default thumb for local videos. Automatically closed - issue fixed for 2 weeks with no activity.