Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: How to Change News Title Tag

  1. #1
    bhansel is offline Junior Member
    Join Date
    Jul 2009
    Posts
    6

    Default How to Change News Title Tag

    Hello...I'm sure this is simple but can't find it...how can I change the title tag for the News page? Google is seeing this as a duplicate title tag (same as index title).

    all of these pages are duplicates:
    news.aspx
    news.aspx?showarticle=2
    news.aspx?showarticle=6

    I don't know what the second and third ones are...

    Thanks!
    Beth

    Version (Code/DB): AspDotNetStorefront ML 7.1.0.0/7.1.0.0
    http://www.obedding.com
    Last edited by bhansel; 04-08-2010 at 07:32 AM.

  2. #2
    Ben-LynxSI is offline Member
    Join Date
    Mar 2010
    Location
    Vancouver, BC, Canada
    Posts
    41

    Default

    bhansel:

    I'm interested in this too! I thought I'd bump this thread and see if anyone has some ideas. Are there any new DB fields in a newer version of ML? I'm using ML 8, perhaps soon to upgrade to v9.

    It'd be a nice idea to add a few DB fields for article SEO if they haven't been added already in v9.
    Ben Swayne - C#/ASP.net/jQuery/Ajax/SEO
    Lynx System Integrators Ltd.
    Lynx Live Agent - real-time analytics, live chat and sales software for ASPDotNetStorefront
    My Personal Website

  3. #3
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    In xmlpackages\page.news.xml.config we added the following between the
    </PackageTransform> and </package> at the end of the file:

    Code:
    	<SearchEngineSettings>
    		<SETitle actionType="transform">
    			<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
    				<xsl:output method="html" omit-xml-declaration="yes" />
    				<xsl:template match="/">
    					<xsl:apply-templates select="/root/NewsArticles/Article" />
    				</xsl:template>
    				<xsl:template match="Article">
    					<xsl:param name="temp">
    						<xsl:if test="/root/QueryString/showarticle=NewsID">
    							<xsl:value-of select="concat(Headline,' (News from ESE)')" />
    						</xsl:if>
    					</xsl:param>
    					<xsl:param name="setoutput">
    						<xsl:choose>
    							<xsl:when test="$temp=''">
    							</xsl:when>
    							<xsl:otherwise>
    								<xsl:value-of select="$temp" />
    							</xsl:otherwise>
    						</xsl:choose>
    					</xsl:param>
    					<xsl:value-of select="$setoutput"  disable-output-escaping="yes" />
    				</xsl:template>
    			</xsl:stylesheet>
    		</SETitle>
    		<SEDescription actionType="transform">
    			<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
    				<xsl:output method="html" omit-xml-declaration="yes" />
    				<xsl:template match="/">
    					<xsl:apply-templates select="/root/NewsArticles/Article" />
    				</xsl:template>
    				<xsl:template match="Article">
    					<xsl:if test="/root/QueryString/showarticle=NewsID">
    						<xsl:value-of select="NewsCopy" disable-output-escaping="yes"/>
    					</xsl:if>
    				</xsl:template>
    			</xsl:stylesheet>
    		</SEDescription>
    		<SEKeywords actionType="transform">
    			<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
    				<xsl:output method="html" omit-xml-declaration="yes" />
    				<xsl:template match="/">
    					<xsl:apply-templates select="/root/NewsArticles/Article" />
    				</xsl:template>
    				<xsl:template match="Article">
    					<xsl:param name="setoutput" select="concat('news,ESE news,',Headline)"></xsl:param>
    					<xsl:if test="/root/QueryString/showarticle=NewsID">
    						<xsl:value-of select="$setoutput" disable-output-escaping="yes"/>
    					</xsl:if>
    				</xsl:template>
    			</xsl:stylesheet>
    		</SEKeywords>
    	</SearchEngineSettings>
    This will change the title, meta description and meta keywords for each page of the news that you have. Annoyingly, couldn't work out how to change it for the news page on it's own.

  4. #4
    Ben-LynxSI is offline Member
    Join Date
    Mar 2010
    Location
    Vancouver, BC, Canada
    Posts
    41

    Lightbulb

    Thanks esedirect! That is very helpful!

    I'll return the favor... although this may be a bit of a hack. You can override the default news page title, and meta tags in news.aspx.cs in the Page_Load event. You can see by default it pulls the page title from the string resources, but doesn't do anything for the meta tags. If you want to do it right you might write some manageable way to load the meta tags here as well. I just hardcoded it...

    Code:
    protected void Page_Load(object sender, System.EventArgs e)
    {
    	if(AppLogic.AppConfigBool("GoNonSecureAgain"))
    	{
    		SkinBase.GoNonSecureAgain();
    	}
    
        // this may be overwridden by the XmlPackage below!
        SectionTitle = AppLogic.GetString("news.aspx.1", SkinID, ThisCustomer.LocaleSetting);
    
        // set the Customer context, and set the SkinBase context, so meta tags to be set if they are not blank in the XmlPackage results
        XmlPackage1.SetContext = this;
    
       SectionTitle = "Lynx System Integrators News";
       SETitle = "Lynx System Integrators News";
       SEDescription = "Lynx System Integrators News - Tips, Info, and more.";
    }
    Hopefully this helps some of you!
    Regards,
    Ben
    Ben Swayne - C#/ASP.net/jQuery/Ajax/SEO
    Lynx System Integrators Ltd.
    Lynx Live Agent - real-time analytics, live chat and sales software for ASPDotNetStorefront
    My Personal Website

  5. #5
    medsupply is offline Senior Member
    Join Date
    Jul 2011
    Posts
    99

    Default

    Ben,

    I wanted to thank you for this tip. This solved my issue of the dupe title tags in the sitemap, manufacturers, news, and contact pages.