Firefox PHP

Module: Breadcrumbs 'Home' to External Site

Posted by Maurice Makaay 
Module: Breadcrumbs 'Home' to External Site
January 15, 2011 11:53AM
This module can be used to modify the breadcrumbs of Phorum in such way
that the original 'Home' breadcrumb is renamed to 'Forums' and that
a new 'Home' link is prepended. The new 'Home' link can be configured
to point to an arbitrary URL.

This is useful for sites that run forums on a deeper level or even another
URL. The new 'Home' breadcrumb can then be used to point back to the
main site.

Changelog:
----------

2011-01-15 v1.0.0

   - Initial revision.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Attachments:
open | download - breadcrumbs_home_to_external_site-1.0.0.tar.gz (1.5 KB)
open | download - breadcrumbs_home_to_external_site-1.0.0.zip (3 KB)
Re: Module: Breadcrumbs 'Home' to External Site
August 09, 2011 01:30PM
Rather than have the word "Home", I wanted to customize this text. I hacked the module to allow this. I've attached the modified code.
Attachments:
open | download - breadcrumbs_home_to_external_site.php (704 bytes)
open | download - settings.php (1.8 KB)
Re: Module: Breadcrumbs 'Home' to External Site
August 09, 2011 04:50PM
You kind of ignore the whole language file here. Therefore, this won't work for multi-lingual sites that use different values for "Home". You also hard-coded the string "Home" as a default.

The proper way to handle renaming "Home" would be to override "$PHORUM['DATA']['LANG']['Home']". Updating the language file or using the module to tweak language strings directly from an admin interface would do.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Breadcrumbs 'Home' to External Site
August 10, 2011 05:29PM
Hmm, Ok. Changing the language file is fine but what if I actually want the word "Home" to be "Home" some other place and not the name of my website. Basically what I'm saying is that I can customize the meaning of the word "Home" but at the expense of breaking the intuitive definition of it. Rather that do that, I think it makes more sense to allow the admin to change this in the module. Since I'm trying to learn the correct way of doing things, how would I go about having the module tweak this string without changing the intuitive definition of the word?
Re: Module: Breadcrumbs 'Home' to External Site
August 12, 2011 02:37AM
You could introduce language support in the module and use module-specific language files to set the string to display. This way, you don't limit the mod for one language only. In the module, you can refer to this module language data.

In the most basic setup, you'd only need an English language file, which simply assigns $PHORUM["DATA"]["LANG"]["Home"] to the custom language key. That makes this backward compatible with directly using the "Home" translation. But when the admin wants something different, this provides all te required flexibility.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Breadcrumbs 'Home' to External Site
August 20, 2011 05:11PM
Awesome module! One less thing I have to write for this project...
Re: Module: Breadcrumbs 'Home' to External Site
December 28, 2011 04:23AM
This module is great, but it would be even sweeter if you could change the text that is displayed for the "Home" and "Forums" links. Either way though, thanks for the cool mod!
Sorry, only registered users may post in this forum.

Click here to login