Could someone please help me do this for my site. I am just starting out with the whole SEO thing and know I have a LONG way to go!!! Here is what I would like it to say
<script language="javascript">document.title="Got Grins Photography - Lakeland, FL Premiere Children's, Teen and Senior Portrait Photgrapher"</script>
I tried to put that in and it wouldnt let me. Thanks!
I am starting WAY at the beginning. I was just reading about keywords and BEGAN to add them.... I need to see examples of steps for SEO. It there a post that does that. Like a step by step of importance:
examples of a good caption (should they all be different?)
I think I found keyword examples
then this started with a good header title? I dont need that?
What is a nicename for a gallery? Ive never even hear of that!!
You don't need this technique any more. Just use NiceNames for your Galleries and Categories and we do it automagically for you.
I have to disagree, the length limit of niceNames severely limits this. You couldn't get remotely close to what he wants.
title="Got Grins Photography - Lakeland, FL Premiere Children's, Teen and Senior Portrait Photgrapher"
You could further clean up the URL by removing the subcategory (in gallery settings) and only using a category since you aren't actually showing the category/sub-category hierarchy on your site.
Thanks for the bug check! I took the opportunity to make some more substantive changes to the code. I didn't like what it did on the home page, so I took it out. The home page now gets its default title. Photo pages show the gallery title followed by the photo title. Here's the new version:
function ContextualizeTitle() {
var separator = " : ";
var smugmugSuffix = " - powered by smugmug";
var insertAt = document.title.indexOf(smugmugSuffix);
var newTitle = document.title;
var newText = null;
if(!IsHomePage()) {
// add photo title
var photoTitleText = GetPhotoCaption();
if(photoTitleText.length > 0) {
newText = separator + photoTitleText;
newTitle = InsertString(newTitle, newText, insertAt);
}
// add album title
var albumTitle = document.getElementById("albumTitle");
if(albumTitle) {
var albumTitleText = GetTextContent(albumTitle);
if(albumTitleText.length > 0) {
newText = separator + albumTitleText;
newTitle = InsertString(newTitle, newText, insertAt);
}
} else {
// add gallery title
var galleryTitle = document.getElementById("galleryTitle");
if(galleryTitle) {
var galleryTitleText = GetTextContent(galleryTitle);
if(galleryTitleText.length > 0) {
var index = galleryTitleText.indexOf(" galleries");
if(index > -1) {
galleryTitleText = galleryTitleText.substr(0, index);
}
newText = separator + galleryTitleText;
newTitle = InsertString(newTitle, newText, insertAt);
}
}
}
document.title = newTitle;
}
}
function GetPhotoCaption() {
var caption = "";
var photoTitle = document.getElementById("caption_bottom");
if(!photoTitle) {
photoTitle = document.getElementById("caption_top");
}
if(photoTitle) {
caption = GetTextContent(photoTitle);
}
return caption;
}
function GetTextContent(node) {
var text = "";
if(node) {
if(node.children) {
text = GetTextContent(node.firstChild);
} else {
if(node.nodeValue) {
text = node.nodeValue; // IE
} else {
text = node.textContent; // mozilla
}
}
}
text = Trim(text);
return text;
}
function InsertString(text, insertText, index) {
var newText = text.substring(0, index) + insertText + text.substring(index);
return newText;
}
function Trim(text) {
var regexp = /^\s+|\s+$/g;
text = text.replace(regexp, "");
return text;
}
function IsHomePage() {
var isHomePage = false;
// test for the "homepage" class name in the <BODY> tag
var classStr = document.body.className;
if (classStr && (classStr.indexOf("homepage") != -1)) {
isHomePage = true;
}
return isHomePage;
}
Awesome Garry Glass and MikeFriend . This is perfectly working for my website now :-) Thanks !
Comments
<script language="javascript">document.title="Got Grins Photography - Lakeland, FL Premiere Children's, Teen and Senior Portrait Photgrapher"</script>
I tried to put that in and it wouldnt let me. Thanks!
www.GotGrins.com
www.gotgrins.com
Portfolio • Workshops • Facebook • Twitter
examples of a good caption (should they all be different?)
I think I found keyword examples
then this started with a good header title? I dont need that?
What is a nicename for a gallery? Ive never even hear of that!!
UGH! I am sorry!!!
www.gotgrins.com
title="Got Grins Photography - Lakeland, FL Premiere Children's, Teen and Senior Portrait Photgrapher"
My Website index | My Blog
THANK YOU
www.gotgrins.com
You could further clean up the URL by removing the subcategory (in gallery settings) and only using a category since you aren't actually showing the category/sub-category hierarchy on your site.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
<li><a href="/gallery/23200203_frfPj8">Seniors</a></li>
Change the link to this
<li><a href="/LakelandFL-1/Senior-Portrait-Photographer/Senior-Portraits/23200203_frfPj8">Seniors</a></li>
/gallery/ is normally used to hide the path for info type unlisted galleries.
My Website index | My Blog
Awesome Garry Glass and MikeFriend . This is perfectly working for my website now :-) Thanks !