Jump to content

Cookie trail -- Navigation in display->do_output

Featured Replies

Posted

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

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.

He's posting a suggestion, it's fine. :rolleyes:

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.

Yeah I realized you could do that.. but for some reason that seems "unclean" to me. I guess I don't like the idea of injecting html in that manner.. but then that may be the norm with the forum.. I'm still learning how things work.

Indeed, build the link and pass it in entirely.

@Will...it's not a bug. :blink:

Okay then, I retract the suggestion. :D

Yeah, there are some internal functions that generate HTML too, which seems somewhat out of place given the template-based design. But I guess it'd be messy either way (as is or as templates), so there's not much that can be done.

Archived

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

Recently Browsing 0

  • No registered users viewing this page.