Giter VIP home page Giter VIP logo

html-breadcrumbs's Introduction

HTML::Breadcrumbs
=================

INTRO

HTML::Breadcrumbs is a module used to create HTML 'breadcrumb trails'
i.e. an ordered set of html links locating the current page within
a hierarchy.

HTML::Breadcrumbs splits the given path up into a list of elements, 
derives labels to use for each of these elements, and then renders 
this list as N-1 links using the derived label, with the final 
element being just a label.

Both procedural and object-oriented interfaces are provided. The OO 
interface is useful if you want to separate object creation and
initialisation from rendering or display, or for subclassing.

Both interfaces allow you to munge the path in various ways, to set 
labels either explicitly via a hashref or via a callback subroutine,
and to control the formatting of elements via sprintf patterns or a 
callback subroutine.

Example usage:

  use HTML::Breadcrumbs qw(breadcrumbs);
  print breadcrumbs(path => '/foo/bar/bog.html');
  # prints: Home > Foo > Bar > Bog    (the first three as links)

  # More complex version - explicit element labels + other stuff
  print breadcrumbs(
    path => '/foo/bar/biff/bog.html', 
    labels => {
      'bog.html' => 'Various Magical Stuff',
      '/foo' => 'Foo Foo',
      bar => 'Bar Bar',
      '/' => 'Start', 
    },
    sep => ' :: ',
    format => '<a target="_blank" href="%s">%s</a>',
  );
  # prints: Start :: Foo Foo :: Bar Bar :: Biff :: Various Magical Stuff
  # the first four elements are links in the given format



INSTALLATION

The standard:

   perl Makefile.PL
   make
   make test
   make install


DEPENDENCIES

File::Basename, Carp.


COPYRIGHT AND LICENCE

Copyright (C) 2003 Gavin Carr

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself. 

html-breadcrumbs's People

Contributors

gavincarr avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.