How to override footer links on per page basis #160

Open
BerkeleyEdu opened this Issue Aug 31, 2012 · 5 comments

Projects

None yet

3 participants

@BerkeleyEdu

Hi,

In MWF 1.2 I set the link in the footer to current file to blank so that it would not be underlined or linked. This is done for usability.

$footer->set_contact('', '');
echo $footer->render();

but this no longer works because all of the footer links are in one array (private $_footer_link_urls) whereas before they we separate (private $_contact_url = '/contact';) so, how can I get this functionality back?

-Sara

@ebollens

I'm a bit confused what you mean by "in the footer to current file to blank so that it would not be underlined or linked"

As for front page links, you can control them in config/global.ini.

@BerkeleyEdu
@ebollens

To change this, you'd need to override the class Default_Footer_Site_Decorator with your own that has custom behaviors. You could simply program it to use the old method instead.

@Trott

Untested, but if you know the URL you want to remove from the footer (but leave the associated text intact), I think you'd do something like this prior to rendering the footer:

function remove_link( $title ) {
    $footer_link_titles = Config::get('global', 'footer_link_titles');
    $footer_link_urls = Config::get('global', 'footer_link_urls');
    $found = array_search($title, $footer_link_titles);
    if ($found !== FALSE) {
        unset($footer_link_urls[$found]);
    }
   Config::set('global', 'footer_link_urls', $footer_link_urls);
}

I'm pretty sure that, or something very close to that, should work. Like I said, untested, sorry. But calling remove_link('Contact') before the render() call on the footer should remove the link (but leave the text).

@BerkeleyEdu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment