Actions

Template

Difference between revisions of "Ogmeta"

From InfoTechPedia

Line 10: Line 10:
 
   |Meta element og-image=https:{{filepath:{{#sub:{{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}}|5}}}}
 
   |Meta element og-image=https:{{filepath:{{#sub:{{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}}|5}}}}
 
   |Meta element og-image-type={{#show: {{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}} |?MIME type }}
 
   |Meta element og-image-type={{#show: {{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}} |?MIME type }}
   |Meta element og-image-width={{#show: {{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}}#_EXIFDATA |?Width }}
+
   |Meta element og-image-width={{#show:{{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}}#_EXIFDATA|?Width }}
   |Meta element og-image-height={{#show: {{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}}#_EXIFDATA |?Height }}
+
   |Meta element og-image-height={{#show:{{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}}#_EXIFDATA|?Height }}
 
   }}
 
   }}
 
</pre>
 
</pre>
 
</noinclude>
 
</noinclude>

Revision as of 11:19, 3 November 2020

This template automatically adds the og meta tags, og:image, og:image-type, og:image-height, and og:image-width.

{{#set:
   |Meta element og-image=https:{{filepath:{{#sub:{{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}}|5}}}}
   |Meta element og-image-type={{#show: {{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}} |?MIME type }}
   |Meta element og-image-width={{#show:{{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}}#_EXIFDATA|?Width }}
   |Meta element og-image-height={{#show:{{#explode:<MANY>{{#show: {{FULLPAGENAME}} |?Attachment_link|format=array}}|<MANY>|1}}#_EXIFDATA|?Height }}
  }}