Menu

Different breadcrumb behavior

Mathias
2008-02-17
2013-04-26
  • Mathias

    Mathias - 2008-02-17

    Replace lines 303-321 with the following:
          // Home album and then all breadcrumps
          for ($i=0; $i<count($previous); $i++) {
            $crumps[] = $previous[$i];
            $previousName = $previous[$i];
            $previousLink = $m3['config']['siteUrl'] . $albumLink . implode('/', $crumps);
            if (count($crumps) == 1) { // Home link
              $previousName = $m3['lang']['pageTitleHome'];
              if ($m3['config']['rewriteUrl']) {
                $previousLink = $m3['config']['siteUrl'] . '/myPh3/';
              } else {
                $previousLink = $m3['config']['siteUrl'] . '/myPh3.core.php';
              }
            }
            if ($i == 0) { // Remove &laquo; from first item in list
                echo '
              <a href="' . $previousLink . '" class="albumprevious">' . $previousName . '</a>';
            } elseif ($i == count($previous) - 1) {
                        echo '
              &amp;laquo; <span class="albumprevious">' . $previousName . '</span>';
            } else {
                        echo '
              &amp;laquo; <a href="' . $previousLink . '" class="albumprevious">' . $previousName . '</a>';
            }
          }

    This will put links in traditional breadcrumb form: home (w/ link) &laquo; album name (w/ link) &laquo; album name (w/ link) &laquo; ... &laquo; current album (no link)

     
    • Mathias

      Mathias - 2008-02-17

      Bah, didn't realize sf.net escapes out HTML entities. Replace &amp;laquo; with &laquo; in the code snippet above. &laquo; is the « character.

       
    • Eric Kok

      Eric Kok - 2008-02-18

      Hi,

      Thanks for sharing your code with us. Do you have an example on how this looks/is different from the default breadcrups? Thanks and hope you like myPh3.

      Gr, Eric

       

Log in to post a comment.