Site Logo Broken Link

Hello,
I have had to change my Rapid Weaver 6 website
http://www.moments-in-nature.de
using the CA OHM theme (from Rapid Ideas).
Now I am using Gallery 3 Stack.

Doing this my site changed from a html-Site into a php-Site.
All (sub-) pages changed from index.html into index.php.

But now the site-logo-link does not work any more.
A click on the site logo links to the former index.html (which is no more here) and I get the message
“The requested document was not found on this server.”

Unfortunately the two tipps:



do not work for my website.

I think I have to change the assigned link of the site logo from index.html into index.php
but I do not know where and how I can do this.
Can anybody help me to make the link working again?
Thanks an best regards
Werner

Have you got access to an FTP program? It looks like you’ve still got the original index.html file in the same folder as the newer index.php. If you remove the index.html (keep a copy, just in case) and refresh the browser it should work fine.

Rob

Hi Rob,

thanks for your quick response.
But I’m afraid there is no index.html file in the sites folder of the Server, see screenshot attached.
There is only the index.php file.
:confused:

I don’t know I’m afraid. It’s quite an old theme isn’t it, I wonder if @cric - the author - might be able to help?

Yes, OHM has been discontinued many years ago. The problem is that the created link points to an index.html file which isn’t found. There are some methods to fix it but none of them is really easy:

  1. use .htaccess on your server to redirect index.html pages to index.php pages (or just use a 404-error redirection)
  2. Go into the theme contents folder in the Finder (right-clicking on the theme in the theme drawer in RW and choose “Show contents…”). Edit the included base.js file (found in Contents/js/jQuery/). Find the lines:
function getSitePath() {
    trimPath='rw_common/themes/ohm/javascript.js';
    sitePath=rwCommonPath.replace(trimPath, '');
    return sitePath;
}

function goHome() {
	jQuery('#logo').hover(function() {
		jQuery(this).css('cursor', 'pointer');
	}, function() {
		jQuery(this).css('cursor', 'default');
	});
	
	jQuery('#logo').click(function() {
		location.href=sitePath+'index.html';
		});
}

and change it to

function getSitePath() {
	trimPath='rw_common/themes/ohm/javascript.js';
	sitePath=rwCommonPath.replace(trimPath, '');

	if (sitePath=='javscript.js') {
		sitePath='/';
	}

	

	return sitePath;

}

function goHome() {
	jQuery('#logo').hover(function() {
	    jQuery(this).css('cursor', 'pointer');
	}, function() {
		jQuery(this).css('cursor', 'default');
	});

	$('#logo').on('click', function(e) {
		location.href=getSitePath();
	});
	
}

The code above hasn’t been tested, so drop me a line if this does not work.

  1. Create index.html pages within RW that redirects to the index.php files

Chris

1 Like

Hello,
I tried it with proposal 2 and replaced the code as suggested.
Now the logo-link causes no more error message, but also do not link to the Home-Site. The link simply does not work.

See here:
http://www.moments-in-nature.de/Flowers/Flowers.php

Perhaps there must be modified/added a little in the suggested code?

Many thank and best regards
Werner

Hm, maybe the “on” handler doesn’t work. Try changing:

$('#logo').click(function(e) { location.href=getSitePath(); });
}

Chris

Hi Chris,

I deleted the “on” but it does not help.
The link is not working.

the code of the base-js now is:

(function($) {
$.fn.wait = function(option, options) {
milli = 1000;
if (option && (typeof option == ‘function’ || isNaN(option)) ) {
options = option;
} else if (option) {
milli = option;
}
// set defaults
var defaults = {
msec: milli,
onEnd: options
},
settings = $.extend({},defaults, options);

    if(typeof settings.onEnd == 'function') {
        this.each(function() {
            setTimeout(settings.onEnd, settings.msec);
        });
        return this;
    } else {
        return this.queue('fx',
        function() {
            var self = this;
            setTimeout(function() { $.dequeue(self); },settings.msec);
        });
    }

}

})(jQuery);

function drawDots() {
jQuery(‘#navcontainer a.current’).add(‘#navcontainer a.currentAncestor’).prepend(‘

’);
if (window.PIE) {
jQuery(‘.dot’).each(function() {
PIE.attach(this);
});
jQuery(‘.dotActive’).each(function() {
PIE.attach(this);
});
}

jQuery('#navcontainer a.current').add('#navcontainer a.currentAncestor').hover(function() {
	jQuery(this).find('div.dot').stop(true, true).switchClass('dot', 'dotActive', 100);
}, function() {
	jQuery(this).find('div.dotActive').stop(true, true).switchClass('dotActive', 'dot', 100);
});

}

function getSitePath() {
trimPath=‘rw_common/themes/ohm/javascript.js’;
sitePath=rwCommonPath.replace(trimPath, ‘’);

if (sitePath=='javscript.js') {
	sitePath='/';
}



return sitePath;

}

function goHome() {
jQuery(‘#logo’).hover(function() {
jQuery(this).css(‘cursor’, ‘pointer’);
}, function() {
jQuery(this).css(‘cursor’, ‘default’);
});

$('#logo').('click', function(e) {
	location.href=getSitePath();
});

}
function addToHeader() {
//jQuery(‘#pageHeader’).before(‘

’);
if (jQuery(‘#content #addToHeader’).length==0) {return;}
jQuery(‘#pageHeader’).html(jQuery(‘#addToHeader’).html());
jQuery(‘#content #addToHeader’).empty();
return;
}

function addToFooter() {
if (jQuery(‘#content #addToFooter’).length==0) {return;}
jQuery(‘#footer’).prepend(‘

’+jQuery(‘#addToFooter’).html()+‘
’);
jQuery(‘#content #addToFooter’).empty();
return;
}

function initSB() {
Shadowbox.init({
players: [“html”,“img”,“swf”,“flv”,“qt”,“iframe”]
});
return;
}

function checkiPhone() {
var iPhone=((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)));
return iPhone;
}

function checkiPad() {
var iPad=navigator.userAgent.match(/iPad/i);
return iPad;
}

function fixiDevSB() {
if (iPhone || iPad) {
jQuery(‘#content a’).click(function(e) {
var relTag=jQuery(this).attr(‘rel’);
if ((/shadowbox/gi.test(relTag)) || (/lightbox/gi.test(relTag))) {
var wScroll=jQuery(window).scrollTop();
wScroll-=30;
var wScrollCSS=wScroll+‘px’;
jQuery(‘#sb-container’).css(‘top’, wScrollCSS);
}
});
}
return;
}

jQuery(function() {
iPhone=checkiPhone();
iPad=checkiPad();
drawDots();
sitePath=getSitePath();
goHome();
addToHeader();
addToFooter();
setUpPhotoAlbumSB();
initSB();
fixiDevSB();
});

Sorry for making circumstances
regards
Werner

Hm, there is an error in your code. You have:

$('#logo').('click', function(e) {
	location.href=getSitePath();
});

But it should be:

$('#logo').click(function(e) {
	location.href=getSitePath();
});

If this still does not work, drop me a line and I will have to make some tests here. But this will take some time.

Chris

Hi Chris,

now it is working. The link links to the Home-site :slight_smile:
Many, many thanks.
For me, HTML writers are heroes !!!

Best regrds and thanks again
Werner

1 Like

Great!

Ha, ha. Actually it is not HTML but javascript - but who cares. It’s just code.

Chris

1 Like