(Not logged on) | Register | Log On
Help!

Search the support forum

Search the rest of the site, including support FAQ:

 

What's Global Moxie?

Global Moxie is the hypertext laboratory of Josh Clark, a designer, developer, and author who offers workshops and consulting for iPhone app design. He’s also creator of Big Medium, a web content management system. Josh spins words and code from multimedia studios in Providence, RI, and Paris, France.

On Shelves

Books by Josh Clark

Tapworthy: Designing Great iPhone Apps

Best iPhone Apps: The Guide for Discriminating Downloaders

iWork ’09: The Mising Manual

You can subscribe to this discussion group using an RSS feed reader. Big Medium Support Forum

Help for the Big Medium CMS

Javascript to block top section clickability fails frm Home page

There are three top sections, just to the right of my Home page, on the horizontal navigation bar, that have subsections. I want to suppress or block the clickability of these three top section navigation boxes. I applied the javascript solution from this page:

http://globalmoxie.com/ask/default.php?bigmed.1.1903.2

I *carefully* (I think) substituted the three slugs from each section as follows below.

It works perfectly when navigating from every section, subsection or article on the site *except* for navigating from being on the Home page. From the Home page each top section clicks through to the underlying top section (not subsection) content. I don't know why, or how to correct it.

Here is my script, as dropped into HTML Preferences > Document and Page Header > Additional HTML box:

<script type="text/javascript" language="javascript">
<!--
(function(){
    var blockSlug = {

        //edit these slug names to match the slugs to block
        slug : { 'personal-change-services' : 1, 'organizational-change-services' : 1, 'theory-and-practice' : 1, },

 
        //don't edit below this line ----------------------
        halt : function() { return false },
        stopLink : function(a){
            var pc = a.up().className;
            var match = pc.match(/bmn_sec-(\S*)/);
            if (match && blockSlug.slug[match[1]]) {
                a.onclick = blockSlug.halt;
            }
        },
        updateLinks : function() {
            $$('div.bmw_navigation a').each(blockSlug.stopLink);
        }
    };
    BM.onDOM.addEvent(blockSlug.updateLinks);
})();
//-->
</script>

See:

http://kellygerling.com

BM version 2.0.8
Safari 5.0 Mac

I would appreciate any help anyone can offer.

Kelly
Kelly Gerling Send private email
07/28/2010
 
 
I tried including the Home page in the blocked sections. It didn't block the Home page and had no effect on the lack of clickability when clicking on the three top section boxes from the Home page.

I wanted to update the Javascript because I made some URL changes, because one of the blocked URLs in now different. Here is the code as it is now:

<script type="text/javascript" language="javascript">
<!--
(function(){
    var blockSlug = {

        //edit these slug names to match the slugs to block
        slug : { 'personal-change-services' : 1, 'portland-seattle-organizational-change-consulting-management-services' : 1, 'theory-and-practice' : 1, },

 
        //don't edit below this line ----------------------
        halt : function() { return false },
        stopLink : function(a){
            var pc = a.up().className;
            var match = pc.match(/bmn_sec-(\S*)/);
            if (match && blockSlug.slug[match[1]]) {
                a.onclick = blockSlug.halt;
            }
        },
        updateLinks : function() {
            $$('div.bmw_navigation a').each(blockSlug.stopLink);
        }
    };
    BM.onDOM.addEvent(blockSlug.updateLinks);
})();
//-->
</script>


My site is http://kellygerling.com
Kelly Gerling Send private email
07/29/2010
 
 
I made a goof in my second sentence in my second note (just above this one):

>>had no effect on the lack of clickability>>

Should have written:

>>had no effect on the lack of SUPPRESSING THE clickability>>

when clicking from the home pages on the to-be-suppressed top sections
Kelly Gerling Send private email
07/29/2010
 
 
Hi Kelly,

Thanks for your note. Great to hear you got this working on most pages. Looking at your home page, it appears that your JavaScript is not included in the head tag. Since it's included in other pages, I'm guessing that this means that you previously created some custom "document and page header" settings for the home page that are overriding the general settings. Give this a try:

1. Go to "Settings>Section Properties."

2. Under the Home section, click the "Customize display preferences" section. If you see a gear next to "Document and page header," that indicates that the home page has custom preferences that differ from the general settings. I think this is probably the case.

3. If so, you can either click the Delete icon to delete those custom settings, or simply click "document and page header" and paste your javascript into the home page's custom settings, too.

4. Rebuild pages.

That should do it!

All best,
Josh
Josh Clark Send private email
07/29/2010
 
 
Thanks Josh.

That did it. I had placed some text for Google in the head area of my Home page code to verify my own site for Google Webmasters, as part of registering my site there. I placed the Javascript under that meta data line. Then the designated three top sections navigation buttons no longer clicked through. The click suppression worked with code placed that way into the Home section.

Thanks as always for your prompt and sage advice.

Kelly

Reference:
http://kellygerling.com
Kelly Gerling Send private email
07/30/2010