Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
I followed this thread, http://our.umbraco.org/projects/website-utilities/meta-tags-for-umbraco/meta-tags-for-umbraco-forum/10222-getting-the-data-from-the-fields
but im still having trouble with getting content into my metatags.
Ismail wrote that a runat=server tag shoulg not be in the head tag - because it would render the macro's inactive.
Is this true, and can anyone tell me the correct macro - or just how to make this work?
<head id="head1" runat="server"></head>
- I've allready created the tabs and generic proberties - and they have the alias metaKeywords and metaDescription.
Please help :)
/djan
This should work:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets "><xsl:output method="xml" omit-xml-declaration="yes"/><xsl:param name="currentPage"/><xsl:template match="/"><title><xsl:for-each select="$currentPage/ancestor-or-self::node[not(string(./data [@alias = 'PageTitle'])='')]"> <xsl:sort select="position()" data-type="number" order="descending"/> <xsl:if test="position()=1"> <xsl:value-of select="./data [@alias = 'PageTitle']" /> </xsl:if> </xsl:for-each></title><meta name="keywords"> <xsl:attribute name="content"> <xsl:for-each select="$currentPage/ancestor-or-self::node[not(string(./data [@alias = 'Keywords'])='')]"> <xsl:sort select="position()" data-type="number" order="descending"/> <xsl:if test="position()=1"> <xsl:value-of select="./data [@alias = 'Keywords']" /> </xsl:if> </xsl:for-each> </xsl:attribute></meta><meta name="description"> <xsl:attribute name="content"> <xsl:for-each select="$currentPage/ancestor-or-self::node[not(string(./data [@alias = 'Description'])='')]"> <xsl:sort select="position()" data-type="number" order="descending"/> <xsl:if test="position()=1"> <xsl:value-of select="./data [@alias = 'Description']" /> </xsl:if> </xsl:for-each> </xsl:attribute></meta></xsl:template></xsl:stylesheet>
someone post, so i can mark as solution ?
.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Getting the data from the fields in ver. 4.0.3
Hi all,
I followed this thread, http://our.umbraco.org/projects/website-utilities/meta-tags-for-umbraco/meta-tags-for-umbraco-forum/10222-getting-the-data-from-the-fields
but im still having trouble with getting content into my metatags.
Ismail wrote that a runat=server tag shoulg not be in the head tag - because it would render the macro's inactive.
Is this true, and can anyone tell me the correct macro - or just how to make this work?
- I've allready created the tabs and generic proberties - and they have the alias metaKeywords and metaDescription.
Please help :)
/djan
This should work:
someone post, so i can mark as solution ?
.
is working on a reply...