Jump to content

Cookie trail -- Navigation in display->do_output


Guest Palamedes

Recommended Posts

When passing an array to do_output that is to be used as the navigation cookie trail, it would be nice if we could also pass URLs. This way we could have more control over our entire cookie trail when creating our own components.

class_display.php line 126 simply says;


if ($n)
{
    $nav .= "<{F_NAV_SEP}>" . $n;
}

where as something more along the line of this seems more useful.

if ($n) {
    if (is_array($n)) {
        $nAnchor = (!empty($n[0]))?$n[0]:"";
        $nUrl = (!empty($n[1]))?$n[1]:"";
        $nTarget = (!empty($n[2]))?$n[2]:"";
        $nav .= "<{F_NAV_SEP}><a href='".$nUrl."' target='".$nTarget."'>".$nAnchor."</a>";
    } else {
        $nav .= "<{F_NAV_SEP}>" . $n;     
    }
}



Thoughts?

Thanks

Link to comment
Share on other sites

When passing an array to do_output that is to be used as the navigation cookie trail, it would be nice if we could also pass URLs. This way we could have more control over our entire cookie trail when creating our own components.



class_display.php line 126 simply says;




if ($n)
 {
     $nav .= "<{F_NAV_SEP}>" . $n;
 }

where as something more along the line of this seems more useful.

if ($n) {
     if (is_array($n)) {
         $nAnchor = (!empty($n[0]))?$n[0]:"";
         $nUrl = (!empty($n[1]))?$n[1]:"";
         $nTarget = (!empty($n[2]))?$n[2]:"";
         $nav .= "<{F_NAV_SEP}><a href='".$nUrl."' target='".$nTarget."'>".$nAnchor."</a>";
     } else {
         $nav .= "<{F_NAV_SEP}>" . $n;     
     }
 }



Thoughts?

Thanks



if I were you post that in here


Did you find a bug in IP.Board?

If you believe you've found a bug please post it to the bug tracker.
Link to comment
Share on other sites

Well, you're misinterpreting how do_output works. To build the breadcrumb trail, you do something like this:

$title = 'Page Title';
$nav = array( '<a href="http://forums.invisionpower.com/">IPS Forums</a>' );
$out = 'This is some text';

$this->ipsclass->print->add_output( $out );
$this->ipsclass->print->do_output( array( 'TITLE' => $title, 'JS' => 0, 'NAV' => $nav ) );


You can add as many breadcrumb elements as you want.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...