September 13, 2007
Hi All -
Before I get too involved in explaining this BANS sitemap MOD, I want to state that you should ALWAYS make a backup of your original files before attempting any modifications. I will generally rename my files with a BAK extension to have a working copy in case of emergency :-) (ex: FrontControlBAK.php.)
The reason I created this MOD is to give website visitors and search spiders a single place to go and find all information about the store categories in one location. The sitemap will create a single page that lists all of your categories and the meta description you have completed within your store administration. At this point, I have not included the custom content pages and may not even do so. In addition, the product listings from the ebay feed are not included due to the frequency of change. The sitemap is intended to be a basic contents section, very similar to a table of contents in a book.
That being said - lets get to the BANS sitemap MOD for Build a Niche Store Ver. 1.3!
Begin by downloading the BANS site MOD text files to avoid html code jacking up the copy/paste function. There is also a set of directions included in the zip file.
The files contained in this zip will enable you to include a public sitemap on your BANS store.
Before changing any of your site files - be sure to make a backup in case of emergency. Also remember that if you update your BANS store with a newer version in the future, you will have to make these changes again, which may or may not work, depending on how the new release is done.
I know for sure that this MOD works on the BANS 2.0 stores - I have not tested it on anything prior.
Files included:
stylecss-changes.txt (Changes to your style.css file located in the theme you are using)
header-changes.txt (Changes to your header.php file in the theme you are using)
frontcontrol-changes.txt (Changes to the FrontControl.php file, located in the cont folder)
Instructions:
##########################################################
Step 1
##########################################################
Go into your BANS store admin and create a new CONTENT page. At the bottom of the page, use a filename that is relevant to¼br> your niche and contains no spaces.
ex: “Myniche-Sitemap” (Replace myniche with your niche market name)
##########################################################
Step 2
##########################################################
After your page is active, open your style.css file in the appropriate editor of your choice (notepad, dreamweaver etc) and¼br> add the contents of the stylecss-changes.txt file to the bottom of the file, just above the </style> tag. Save the file and upload to your server.
##########################################################
Step 3
##########################################################
Open your FrontControl.php file and search for:
function getMainPageParent(){
DIRECTLY ABOVE that code, copy and paste the text from the frontcontrol-changes.txt file. Save your changes and upload the¼br> file to your server.
##########################################################
Step 4
##########################################################
Open your header.php file from inside the theme directory you are using. This can be done within the admin of your store or¼br> in your own favorite text editor. At the very bottom of the code, you should see:
Directly ABOVE the closing head tag (</head>) Paste the following code:
<?php
function curPageURL() {
$pageURL = ‘http’;
if ($_SERVER["HTTPS"] == “on”) {$pageURL .= “s”;}
$pageURL .= “://”;
if ($_SERVER["SERVER_PORT"] != “80″) {
$pageURL .= $_SERVER["SERVER_NAME"].”:”.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
This will get the current page URL from the server.
Next, look for:
<div id=”content” class=”narrowcolumn”>
Directly AFTER that code, paste the code from the header-changes.txt file shown below.
<?php if (curPageURL() == “http://www.mynichedomainname.com/my-sitemap-filename“)
{{echo “<div id=sitemap><ul id=’sitemap’>”;}
{echo $front->sitemapnav();}
{echo “</ul></div>”;}}
?>
You MUST change the http:// information to reflect your own domain name and the sitemap file you created. The easy way of¼br> making sure this is exact will be to open your BANS site in a web browser and click on the menu item for your sitemap page.¼br> Once the blank page is open in front of you, highlight the entire URL in the address bar and copy/paste it into your header¼br> file section above.
After you are done - save your work and/or upload the file to your server in the same folder as your theme.
If you have any problems - feel free to email me directly at Mark@TheKidsCollegeFund.com or post to the blog or BANS forum.
Thanks and enjoy!
Mark
37 Responses to “Build a Niche Store Sitemap MOD - Complete version!”
Got something to say?
Mark,
My BANS site is ver. 2.0 and I updated the script with your Sitemap Mod just as you described in the text file. I am not getting any output on the content page. No errors are showing, either. Any suggestions?
-Ross-
http://www.ratrodbarn.com
Hi Ross -
I just visited the site and see it perfectly!
http://www.ratrodbarn.com/Rat-Rod-Sitemap
Mark
Beats ME!!!….I could’nt get it to display today or last night. I’ve made no changes to it since the first install??
I don’t KNOW???????????????
It works now but I don’t know why?..Oh well I appreciate your help,regardless.
When I get up enough courage, I will buy Wordtracker through your link.
Thanks,
Ross
DUH!!!!!!!
my page name is Rat_rod-Sitemap
my link points to Rat-Rod-SiteMap
Hi Mark,
I want to add a sitemap and link to it on my BANS.
I downloaded the .css from the themes folder I am using.
When I open it in DW and look at it there is no: tag anywhere.
Nor is there a starting in the css of Template 1 Both .
The style tags are already defined in the code of the file call…
There is no real need for opening or closing style tags.
Mark
So how do I do Step 2?
“add the contents of the stylecss-changes.txt file to the bottom of the file, just above the tag.”
I don’t know where just above the style tag is.
Hi Mark,
I am trying to add the sitemap as per your instructions but I am getting the following error when I go back into my site:
Parse error: syntax error, unexpected ‘:’ in /home/gerryp29/public_html/themes/layout-3-both/header.php on line 22
regards
Gerry
PS your site has been a great resource for me as I am new to this stuff
Hi Mark,
I managed to get this easily installed when I was working in a test folder. Now that I have transferred all the files to the main folder, I can’t get the sitemap to work. I transferred all the files and then went into the header.php and deleted the “/test” from the URL (minus the quotes) which was the only difference. I’ve checked all the code and everything looks right.
If I leave the /test out, then neither the test site or the live site will show the sitemap … but if I put /test back in, then the test site shows the sitemap altho the live site still doesn’t.
Is it finicky enough that I need to delete, save, and re-add each of the steps?
Thanks!
Cindy
Mark,
You can ignore my previous note. Everything works as it should now. Based on some other comments I’ve read here and at the BANS forum, I’m thinking that for some reason some of the changes don’t happen immediately but if you wait about 30 minutes or so, the changes do show up. A little strange … but as long as it does work!
Cindy
I noticed that I need to add both http://www.domainname.com/site-map and domainname.com/sitemap (with and without the www) to make it work. How do I add the second domain?
”;}
{echo $front->sitemapnav();}
{echo “”;}}
?>
Thanks for the great website and sharing your knowledge.
Thomas
Thomas -
Please send me the url of the site…
In most cases, if your site is set to display http://www. in the url, you can change the function CurPage section to: $pageURL .= “://www.”;
Shoot me a url - I will look.
Mark
Hi there,
I tried to install the sitemap but it is not showing anything. Can you have a look.
http://www.legoshop.info/Lego-Shop-Sitemap
@ Menno -
Please send me the admin info for the site - it looks like a result of copy/paste, otherwise there would be site errors.
Likely in the curpage section.
send to mark -at- thenichestorebuilder.com
Mark
Great mod, works perfectly for me:
http://www.magazinemavens.comMagazines-Sitemap
Thank you Mark!
Diana
I received the same
Parse error: syntax error, unexpected ‘:’ in
message in my header file. I copy and pasted the lines exactly as posted. Any suggestions? (
I also received this error -
Parse error: syntax error, unexpected ‘:’ in
When I compared my current admin folder to one I had successfully completed before, I noticed that the glaring difference was the ” and ‘ which turned out to be the problem. It looks like the above text was copied and pasted from a Word document which carried over the funky characters. You’ll need to change them on your computer and you’ll be good to go. Probably would be wise to make a “good” copy in Notepad and save it with the other files so that this doesn’t have to be corrected each time.
Cindy
I have followed the directions as instructed. My problems only start to occur in header.php file. My page is just all white when I try to load it..
Here is the header code
“;}
{echo $front->sitemapnav();}
{echo “”;}}
?>
the screen screen just appears blank. my file name is mic-Sitemap.
Hi,
Is there a way to include content from the right sidebar in a 3-column layout?
My content is in the right sidebar, which is controlled by the footer-php file (right sidebar and footer are the same file).
It is probably me Mark, but I am trying to carry out the sitemap mod. I created a new content page with the file suggested. I have opened the style.css file but I cannot find the tag at all near the btm of the file. Any ideas please.
David Welton
I have a basic file management question. I am having difficulty getting the frontcontrol.php file uploaded to my serever. Can you please help me with the process. I use Hostgator.
Thanks for the help and the great website.
Hi Mark,
I’ve been trying to install the sitemap and keep getting this error
Parse error: syntax error, unexpected ‘:’ in /home/moreforu/public_html/winbestweddingprices/themes/layout-2-both/header.php on line 22
I can’t find unexpected ‘:’
I see that others have had the same error but from what Cindy said I’m not sure how I should be correcting this, any help would be appreciated.
Thanking you
Carmel
Hi Mark,
I am having a problem with figuring out step 4. My BANS version is 1.3 and I can’t seem to find the
Code under which I am supposed to paste the header changes. I believe 1.3 was created slightly different, could you please tell me how i would modify this to work for me?
I had errors mentioned by others here. I resolved them by replacing the single and double quotes in the code. Copy the code from the instructions into Notepad and change the single quotes around ‘http’ and the double quotes everywhere else. There are 10 sets of double quotes.
Save the changes and reload the page.
@ Mark:- thanks for the great help here.
Mark,
This is the second site that I have added the sitemap mod, but I gat none of the description text when viewed? Also, on another computer on my network, I get a blank page, nothing. Take a look at http://australia.myrocknrollshop.com
Great work, love what you are doing. Keep it up.
Mark,
Just when to the site using no www and got nothing, but with the www in place it displays, but still coments under the heading.
re: sitemap not showing with either http://www.dn.com or http://dn.com (On BlueHost in case that matters)
I’m no pro here but I got them to both work by entering the code twice, one after the other, in the header.php file in the Theme directory. One has the ” http://www. ” and the other does not. Nothing elegant about it, but it seems to be working.
”;}
{echo $front->sitemapnav();}
{echo “”;}}
?>
”;}
{echo $front->sitemapnav();}
{echo “”;}}
?>
Hope that helps.
Mark, Thank you. Lovin’ the schoolin’.
OOPs That came out wrong. Should be
re: sitemap not showing with either http://www.dn.com or http://dn.com (On BlueHost in case that matters)
I’m no pro here but I got them to both work by entering the code twice, one after the other, in the header.php file in the Theme directory. One has the ” http://www. ” and the other does not. Nothing elegant about it, but it seems to be working.
”;}
{echo $front->sitemapnav();}
{echo “”;}}
?>
”;}
{echo $front->sitemapnav();}
{echo “”;}}
?>
—>
Don’t copy the ” ”
Hope that helps.
Mark, Thank you. Lovin’ the schoolin’.
Sorry about that, I screwed something up on my post. I meant to say
e: sitemap not showing with either http://www.dn.com or http://dn.com (On BlueHost in case that matters)
I’m no pro here but I got them to both work by entering the code twice, one after the other, in the header.php file in the Theme directory. One has the ” http://www. ” and the other does not. Nothing elegant about it, but it seems to be working.
”;}
{echo $front->sitemapnav();}
{echo “”;}}
?>
”;}
{echo $front->sitemapnav();}
{echo “”;}}
?>
–>
Hope that helps.
Mark, Thank you. Lovin’ the schoolin’.
Hi,
Can someone please paste in or post a link to a completely functioning header.php file? I’ve got the parse error and can’t figure out exactly how to change the quotes / double quotes to get it to work.
Or if someone could state exactly where we should have quotes or double quotes, I’ll give it another shot. I read “change them” and thought “change them to what?” and “what do you mean by “them”"
Sorry for the confusion but I’m on my first site and hitting the learning curve pretty hard.
Thanks for all the help!