Page titles for my Smugmug website

Mohamed.GhuloomMohamed.Ghuloom Registered Users Posts: 305 Major grins
edited February 28, 2009 in SmugMug Support
Smugmug is very fast in getting indexed by google.. I add a new album and after 30 minutes I see it indexed (wow). But there is this slight problem. All the pages get indexed with the same page title exactly.. (About us, galleries, homepage, everything)
See here

Is there a way or if no way (im suggesting this feature) to have different titles for my pages? Instead of all being like this:

LENS Photography (Photography service in Bahrain)- powered by SmugMug

LENS Photography (Photography service in Bahrain)- powered by SmugMug

LENS Photography (Photography service in Bahrain)- powered by SmugMug

LENS Photography (Photography service in Bahrain)- powered by SmugMug

it becomes like this:
LENS Photography (Photography service in Bahrain)- powered by SmugMug - Homepage

LENS Photography (Photography service in Bahrain)- powered by SmugMug - About us


LENS Photography (Photography service in Bahrain)- powered by SmugMug - Clouds & Sunsets

LENS Photography (Photography service in Bahrain)- powered by SmugMug - Galleries

LENS Photography (Photography service in Bahrain)- powered by SmugMug - University Category


We all know it's powered by Smugmug, and in the footer it always shows. Is there a way to remove that, so it becomes shorter?
Mohamed Photos
Give a Message

Comments

  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited January 26, 2009
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Mohamed.GhuloomMohamed.Ghuloom Registered Users Posts: 305 Major grins
    edited January 27, 2009
    It toke me 14 pages to get this done, and bottom line:
    Add this to your top javascript:
    /*
    --------------------------------------------------
        ContextualizeTitle Settings
    --------------------------------------------------
    */
    var titleSettings = {
        separator    : ": ",    // Text to insert between parts of title.
        maxLength    : -1,      // Limits length of title (-1 == no limit).
        doPhotos     : true,    // true == append photo captions
        doAlbums     : true,    // true == append album names
        doGalleries  : true,    // true == append gallery names
        stripSmugmug : true,    // true == remove " - powered by SmugMug" from title bar text
        inverse      : false,   // true == reverse order of home/gallery/album/photo
        siteTitle    : null     // null == use normal site title. "" == suppress site title. "Any Value" == replaces normal site title.
    };
    
    /*
    --------------------------------------------------
        ContextualizeTitle Class
    --------------------------------------------------
    */
    function ContextualizeTitle ()
    {
        var pieces = new TitlePieces();
        var newTitle = "";
        if (titleSettings.inverse)
        {
            newTitle = MakeTitleBackward();
        }
        else
        {
            newTitle = MakeTitleForward();
        }
        if (titleSettings.maxLength > -1)
        {
            newTitle = newTitle.substr(0, titleSettings.maxLength);
        }
        if (titleSettings.stripSmugmug == false)
        {
            newTitle += " - powered by SmugMug";
        }
        document.title = newTitle;
    
        // METHODS
    
        function MakeTitleBackward ()
        {
            var title = "";
            title += pieces.Photo
            if (title.length > 0
                && pieces.Album.length > 0)
            {
                title += titleSettings.separator;
            }
            title += pieces.Album;
            if (title.length > 0
                && pieces.Gallery.length > 0)
            {
                title += titleSettings.separator;
            }
            title += pieces.Gallery;
            if (title.length > 0
                && pieces.Main.length > 0)
            {
                title += titleSettings.separator;
            }
            title += pieces.Main;
            return title;
        }
    
        function MakeTitleForward ()
        {
            var title = "";
            title += pieces.Main;
            if (title.length > 0
                && pieces.Gallery.length > 0)
            {
                title += titleSettings.separator;
            }
            title += pieces.Gallery;
            if (title.length > 0
                && pieces.Album.length > 0)
            {
                title += titleSettings.separator;
            }
            title += pieces.Album;
            if (title.length > 0
                && pieces.Photo.length > 0)
            {
                title += titleSettings.separator;
            }
            title += pieces.Photo
            return title;
        }
    
        // CLASSES
    
        function TitlePieces ()
        {
            this.Main = GetMainTitle();
            this.Gallery = GetGalleryTitle();
            this.Album = GetAlbumTitle();
            this.Photo = GetPhotoTitle();
    
            function GetMainTitle ()
            {
                var value = titleSettings.siteTitle;
                if (value == null)
                {
                    var index = document.title.indexOf("- powered by SmugMug");
                    value = document.title.substr(0, index);
                }
                return value;
            }
    
            function GetGalleryTitle ()
            {
                var value = "";
                if (titleSettings.doGalleries)
                {
                    var element = document.getElementById("galleryTitle");
                    if (element)
                    {
                        value = GetTextContent(element);
                        if (value.length > 0)
                        {
                             // remove " galleries" from title
                            var index = value.indexOf(" galleries");
                            if (index > -1)
                            {
                                value = value.substr(0, index);
                            }
                        }
                    }
                }
                return value;
            }
    
            function GetAlbumTitle ()
            {
                var value = "";
                if (titleSettings.doAlbums)
                {
                    var element = document.getElementById("albumTitle");
                    if (element)
                    {
                        value = GetTextContent(element);
                    }
                }
                return value;
            }
    
            function GetPhotoTitle ()
            {
                var value = "";
                if (titleSettings.doPhotos)
                {
                    var element = document.getElementById("caption_bottom");
                    if (!element)
                    {
                        element = document.getElementById("caption_top");
                    }
                    if (element)
                    {
                        value = GetTextContent(element);
                    }
                }
                return value;
            }
    
        }
    
    } // end of ContextualTitle class
    
    /*
    --------------------------------------------------
        Utility Methods
    --------------------------------------------------
    */
    
    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 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;
    }
    

    Add this to your bottom javascript
    YE.onDOMReady(ContextualizeTitle);
    Mohamed Photos
    Give a Message
  • ashishpandeyashishpandey Registered Users Posts: 100 Big grins
    edited January 28, 2009
    Is there a way or if no way (im suggesting this feature)

    If you have gone through the other thread posted above, you would see that this is a topic / request that SmugMug has been very blatantly ignoring to even discuss. For some reason they don't even come out and say - no we will not do it rolleyes1.gif
    Ashish
    http://photography.ashishpandey.com
    smugmug ID: ashishpandey (but I prefer my domain URL above :D)
  • Mohamed.GhuloomMohamed.Ghuloom Registered Users Posts: 305 Major grins
    edited February 28, 2009
    I do still think that this should be fixed..
    Still my page titles are so LONG that they don't show full in google.. so when it comes to the gallery name it's "..." instead..

    Come on smugmug, we don't like the "powered by smugmug" thingy.. we want our websites more like OUR OWN! Already the "powered by smugmug" will be mentioned down the website in the footer.. PLZ bowdown.gif
    Mohamed Photos
    Give a Message
Sign In or Register to comment.