Navigation with protocols

edited July 2015 in Feature Requests
I was wondering if it's possible to use the navigation / menu class configuration array to include protocols, not just paths?

For example have mailto: or tel: protocols as the key, such that fuel_nav() could render these and not just urls?

I would like to append a protocol type link to a regular navigation array, but this doesn't work currently.

Comments

  • edited 9:20PM
    I'm assuming this is when you save navigation in the CMS correct? If so, I've added a fix for that in the develop branch:
    https://github.com/daylightstudio/FUEL-CMS/commit/316564eb390145512955200eb1df95940c0fea41
  • edited July 2015
    OK I've had a chance to try this out and what I was hoping to do (I'll use the "append" feature of fuel_nav() to illustrate), was this:
    // in _variables/global.php $vars['clever_appends'] = array( 'tel:' => '0123 4567890' ); // in the menu echo fuel_nav( array( 'group_id' => 'some_id', 'container_tag_class' => 'nav navbar-nav', 'container_tag_id' => 'some-nav', 'append' => $clever_appends ) );
    and the menu link would be
    <a href="tel:0123 4567890">0123 4567890</a>

    Doing the above with fuel_nav() doesn't really work, as the location (the tel:) is prepended with the base url. If a protocol were detected, that could be dispensed with?
  • edited 9:20PM
    That requires an update to the url_to() function in the MY_url_helper.php. What other protocols other then tel: do you know of?
  • edited 9:20PM
    I'll take a look at url_to().

    Admittedly non-http protocols might be considered somewhat academic for menu links, but some other common ones are:

    mailto:
    ftp:
    file:


    In fact there are dozens more recognised by the IANA, however many wouldn't even be actionable by browsers:

    https://en.wikipedia.org/wiki/URI_scheme
  • edited 9:20PM
    OK. Those are the ones I saw as well. mailto is already setup and the other 2 don't seem like they should be applicable. I've added tel to the develop branch.
Sign In or Register to comment.