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

New Post: keywords SEO

$
0
0
Hi Meir,

If you want something like:
<meta name="Keywords" content="CMS, Composite C1, etc etc etc" />
on your pages, you can do it in this way:
  1. Create a page meta type, say, "My.Meta.Keywords" with one string field, say, "Content". Make the field optional, too.
  2. Add the field of this type to your pages (right-click on a home page > "Add Metafield") with default valaues.
  3. Create a C1 function (Razor, XSLT) that will get the value of this field on the current page and add <meta name="Keywords" content="" />.
  4. Insert this function on every page via page templates to cover multiple pages at once.
For the XSLT function, for example, you should:
  1. add a function call to your data-retrieving function (something like, "My.Meta.Keywords.GetKeywordsXml")
  2. filter retrieved items by the current page (use the "My.Meta.Keywords.ActivePageReferenceFilter" - something like that - in the data function's Filter property)
  3. add the required markup for the meta keywords element to the XSLT template, something like this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:in="http://www.composite.net/ns/transformation/input/1.0"
 xmlns:lang="http://www.composite.net/ns/localization/1.0"
 xmlns:f="http://www.composite.net/ns/function/1.0"
 xmlns="http://www.w3.org/1999/xhtml"
 exclude-result-prefixes="xsl in lang f">
 <xsl:template match="/">
  <html>
   <head>
    <meta name="keywords" content="{/in:inputs/in:result[@name='GetKeywordsXml']/Keywords/@Content }" />
   </head>
   <body>
   </body>
  </html>
 </xsl:template>
</xsl:stylesheet>
You'd better also add the if-then logic to the markup above to check for an an empty "Content" value, in which case, no <meta/> will be added.

Now you need to edit the pages where you want the meta tag to appear and specify the keywords on the "Metadata" tab.

BTW, I don't think that SEO Assistant takes the <meta name="keywords" .../> into consideration.

Viewing all articles
Browse latest Browse all 2540

Trending Articles



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