Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Controlling HTML Head

$
0
0
I clearly didn't think this through when writing the filtering. I will log it as a bug.

The general idea with the filtering was that you can have a general C1 Function ensuring open graph tags for all pages - and if a specific function overrides the tags, the specific function's output is used instead.

A workaround is to wrap the <meta property="og:image" /> elements inside <![CDATA[ ... ]]> section. This workaround works fine when the content originate from a C1 Function.

Example of a razor function emitting multiple og:image tags:
@inherits RazorFunction

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <![CDATA[
            <meta property="og:image" content="http://ia.media-imdb.com/images/rock1.jpg" />
            <meta property="og:image" content="http://ia.media-imdb.com/images/rock2.jpg" />
        ]]>
    </head>
    <body>
        <h1>og image tags was added</h1>
    </body>
</html>

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>