All examples on this page use the breadcrumbs class.Description: Show directory and file path with links for instance like this: home > classes > breadcrumb > index.php
1. Symbol separator: Specify what symbols to use between your directory names. $breadcrumb->symbol=' || '; home || classes || breadcrumb || index.php $breadcrumb->symbol=' <> '; home <> classes <> breadcrumb <> index.php 2. Special formatting: I also added a "special" formatting which allows you to show the path as if Elmer Fudd wrote it, or a Hacker wrote it, or in Reverse or hey even in pig latin! $breadcrumb->special='elmer'; home > cwasses > bweadcwumb > index.php $breadcrumb->special='hacker'; }{0|V|3 > (L45535 > BR34D(RU|V|B > 1|\|D3X.P}{P $breadcrumb->special='reverse'; emoh > sessalc > bmurcdaerb > php.xedni $breadcrumb->special='pig'; omehay > lassescay > readcrumbbay > index.phpyay 3. CSS Class Style: Use a css class to define the look of your breadcrumb. $breadcrumb->cssClass='crumb'; home > classes > breadcrumb > index.php 4. Replace Underscores: Replace underscores with spaces. Additional Example $breadcrumb->_toSpace = TRUE; home > classes > breadcrumb > index.php 5. Frameset Target: Target a frameset. $breadcrumb->target = '_blank'; home > classes > breadcrumb > index.php 6. Homepage naming: A person can use any name for the homepage/base directory or not show it at all. $breadcrumb->homepage='homepage'; homepage > classes > breadcrumb > index.php $breadcrumb->homepage=''; classes > breadcrumb > index.php 7. (NEW) Set Root Index Page: Sets the root index page link for those who have a splash page and do not want the home breadcrumb to take them to the splashpage. $breadcrumb->rootIndexLink='index2.php'; home > classes > breadcrumb > index.php 8. (NEW) Unlink Current Directory: Removes the current directory link. $breadcrumb->unlinkCurrentDir=TRUE;
home > classes > breadcrumb > index.php 9. Case formatting: Specify the format you would like the directory names to be in, first letters uppercase, all uppercase, all lowercase, or the actual naming of your directory with no changes. $breadcrumb->dirformat='ucfirst'; Home > Classes > Breadcrumb > Index.php $breadcrumb->dirformat='uppercase'; HOME > CLASSES > BREADCRUMB > INDEX.PHP $breadcrumb->dirformat='lowercase'; home > classes > breadcrumb > index.php $breadcrumb->dirformat='ucwords'; - (Additional Example) Home > Classes > Breadcrumb > Index.php $breadcrumb->dirformat='titlecase'; - (Additional Example) Home > Classes > Breadcrumb > Index.php 10. Use images: Use images in place of text for your breadcrumbs, by specifying the directory the images can be found in. You can also specify the image type (gif, jpg, etc), border, id, name, hspace, vspace, align, height, width, and alt attributes. I have also included an example of how to use an image for the separator character. If you use the changeName function along with images, the alt attribute will be the changed name, while the id and name attributes will remain the actual directory name. $breadcrumb->imagedir=array('path' => 'images/');
$breadcrumb->imagedir=array('path'=>'images/', 'type'=>'gif', 'border'=>2, 'id'=>FALSE, 'name'=>TRUE, 'hspace'=>2, 'vspace'=>4, 'align'=>'top', 'height'=>20, 'width'=>75, 'alt'=>TRUE, 'title'=>TRUE); $breadcrumb->imagedir=array('path' => 'images/'); 11. Directory aliasing: Rename your directories to whatever you would like them to show up as in your breadcrumb. $breadcrumb->changeName=array('home'=>'Baskettcase Homepage', Baskettcase Homepage > PHP Classes > Breadcrumbs Class > index.php 12. Remove Directories: Hide a directory from showing in the breadcrumb. $breadcrumb->removeDirs=array('classes'); home > breadcrumb > index.php 13. Show filename: Specify whether or not to show the current file name, just show the path or show the path with the file name. $breadcrumb->showfile=FALSE; home > classes > breadcrumb $breadcrumb->showfile=TRUE; home > classes > breadcrumb > index.php 14. Index exists?: Set your index file name so that if the file exists then link the directory, otherwise if the file does not exist do not create a link. This is good for those people that do not want surfers to be able to look at their directory structure if they do not have a default index page within that directory. It will still show the directory name within the breadcrumb, but it will not add a link to the directory name. $breadcrumb->fileExists=array('index.htm','index.php','index.html'); home > classes > breadcrumb > index.php 15. Hide File Extension: Hides the filename extension $breadcrumb->hideFileExt = TRUE; home > classes > breadcrumb > index 16. Filename Aliasing: Change the filename to a more user friendly one. $breadcrumb->changeFileName=array('/classes/breadcrumb/index.htm'=>'Breadcrumbs PHP Class v. 2.4.4.1'); home > classes > breadcrumb > index.php 17. Filename Linking: Links the filename to itself. $breadcrumb->linkFile = TRUE; home > classes > breadcrumb > index.php It is a real easy class to implement and if you have any other ideas feel free to . |
|
|||||||||||||||||||||||