Return to AspDotNetStorefront.com

Go Back   AspDotNetStorefront Community | ASP.NET eCommerce Shoppingcart Software > Products > AspDotNetStorefront ML
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old   
K-BL {Offline}
Member
 
Join Date: Aug 2008
Location: USA
Posts: 43
Talking How To: Customize Section Title/BreadCrumb - 06-05-2009

Ok guys, I love aspdotnetstorefront, but I really think it's quite lame to not include much about this pesky little guy, especially because it's an important part of our pages. When you look it up on the forum you get a vagily generic - "Well you could modify the sql to..." or "You can modify it here..." but never a real answer. So I'm here today to tell you it's quite easy.

Of coarse every site/developer works somewhat differently, but I chose to use the package attribute "displayname" (note: all lower case) from where I'll pull my Section Title/BreadCrumb from for custom pages that are built from XmlPackages.

Code:
<package displayname="My Section Title" version="2.1" debug="false" allowengine="true" includeentityhelper="true">
xslt/xml child attributes here.....
</package>
If your package doesn't have this attribute, no sweat, just add it.

Next, make sure you are invoking the Section Title in your skin "template.aspx" - which is "(!SECTION_TITLE!)" - with no quotations. It needs to be where you want the section title listed.

Next, open up "App_Code/SkinBase.cs" in a text editor (perferably VS).

Find this line:
Code:
             s = s.Replace("(!SECTION_TITLE!)", SectionTitle);
Replace it with this:


Code:
            string backupSectionTitle = "";
            try
            {
                XmlPackage2 x = new XmlPackage2(CommonLogic.QueryStringCanBeDangerousContent("XmlPackage"));
                if (x.DisplayName.Length > 0)
                {
                    backupSectionTitle = x.DisplayName;
                }
            }
            catch (Exception err)
            {
            }
            s = s.Replace("(!SECTION_TITLE!)", (SectionTitle.Length > 0 ? SectionTitle : backupSectionTitle));
Reload or Recompile and you're done!

Easiest and most profound mod I've ever done.


K-BL

Last edited by K-BL; 06-05-2009 at 04:20 PM.. Reason: Forgot a step! :)
Reply With Quote
  #2  
Old   
mgibbs {Offline}
Senior Member
 
Join Date: Jan 2005
Location: Orange County, CA
Posts: 190
Default 06-06-2009

Thanks K-BL.

Your post inspired me to go in and modify the Breadcrumb in a way that I've always wanted to.

From a design standpoint, I've never liked how the actual product I'm in shows up in the breadcrumb trail. More importantly, from an SEO standpoint, I've always wanted the first occurrence of the page name (topic, section, category, manufacturerer, product, etc) to show up as a Heading 1 the first time it appears on the page. Unfortunately, for those pages that show this value automatically (products

I've posted (boasted?) about how to do this in my blog. http://exhibita.com/blog/post/2009/0...torefront.aspx
__________________
EMM for AspDotNetStorefront - Communicate effectively with your customers
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
vBulletin Style by: vBskincenter.com
Copyright © 2008, AspDotNetStorefront. All rights reserved.