I'm making a widget for adobe muse, and I need to know how to place a domain name in front of the content of a meta property tag



The widget I'm making uses Open Graph tags and I'm running into a complication when it comes to the "og:image" meta tag. I stripped out the rest of the irrelevant code, but this is what is causing the problem:



<?xml version="1.0" encoding="UTF-8"?>
<HTMLWidget>

<parameters>
<file name="ogImage" label="Image"/>
<!-- This enables the user to upload an image-->
</parameters>

<headHTML>
<meta property="og:image" content="{param_ogImage}" />
</headHTML>

</HTMLWidget>


The code that this will output is:



<meta property="og:image" content="/assets/example-image.png"/>


Facebook debugger will then say:



Object at URL 'http://www.example.com/' of type 'website' is invalid because the given value '/assets/image.png' for property 'og:image:url' could not be parsed as type 'url'.



So, my question is, is there a way to automatically grab and place the domain name in front of the {param_ogImage} content? Is it possible to use something like this to accomplish this task?



<script>
function myFunction() {
var x = document.domain;
document.getElementById("demo").innerHTML = x;
}
</script>

No comments:

Post a Comment