Linking to individual forms

I have just tried it. In my editor I added a new Form based on Custom HTML. In the properties menu on the right side I have clicked Edit next to the HTML which opened an HTML editor. There I added:

<head>
  <meta name="og:title" content="Does this custom title work?">
</head>
Foo Bar

After running the app I see Foo Bar on my page and after inspecting the rendered html code, my custom <head> ... </head> was inserted somewhere into the <div class="content"> ... </div> which actually makes sense from the Anvil perspective.

So this seems not to be a way of actually adjusting the meta data of a custom HTML page. Even if it was possible, I do not think filling it with data from the database would be an easy thing.

Was this the idea you had @jshaffstall or did you envision it differently? Thanks

Later I tried changing the metadata with javascript. So I have added this code exactly where I was previously trying to add the <head> tag.

<script>
  document.title = "This is the new page title.";
  document.getElementsByTagName('meta')["og:title"].content = "This is the new og title";
  $('head').append('<meta name="twitter:description" content="This is a Twitter description."/>');
</script>

This actually worked and changed/added the metadata. Cool. But in this forum question Javascript not working in Custom HTML Form @meredydd specifically says javascript should go into Native Libraries and not into the custom HTML code because it can cause troubles. Also I have no clue how to actually fill the js with data from the db in this case.

I also tried to parse the page with Facebook Debugger just to see whether they are able to parse the correct updated metadata, but I got this error from them:

“We can’t review this website because the content doesn’t meet our Community Standards. If you think this is a mistake, please let us know.”

So I did let them know. But currently I am unable to check whether it works. Also Google’s URL Inspector works only on domains which I have added in my Search Console as a property which is weird to do on a private development link from Anvil.

I also tried to parse the page with Twitter URL Validator, unfortunately, that tool seems not to see the updated meta.