Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
Tango21 #1
Dynamic Breadcrumbs question
Hi,
I am trying to implement this dynamic breadcrumbs script:
[url]http://www.macromedia.com/devnet/dreamweaver/articles/breadcrumbs.html[/url]
The article above talks about creating a Macromedia extension to insert the
breadcrumbs php. I am not interested in the extension aspect of this article,
but rather in getting the php code that generates the breadcrumbs to work.
What do I add to my html file for it to call the php script and make this
thing work? Can anyone break it down for me in simple terms?
I have looked on a lot of other websites for breadcrumb navigation code and
there are several php script options, however no one explains step-by-step how
to call it from your html file. I am building an intranet and our programmer
just quit, so I'm rather up a creek without a paddle. My expertise is in
navigation, design, html, etc. I have very little experience with php. Hate to
be an ignoramous about what is probably painfully obvious to others, but any
help someone could provide would be greatly appreciated.
Tango21 Guest
-
Kaosweaver Breadcrumbs
I have been using the Kaosweaver Breadcrumbs script on my new site which works great. The only problem is that when I validate the page for W3C... -
Breadcrumbs
Could someone please give me some suggestions about including breadcrumbs, or something like, on a website. The site is static, and I do not have... -
Breadcrumbs?
I'm trying to implement a breadcrumbs trail through my site and am using the code detailed below. This works fine but I have a couple of questions:... -
dynamic text question???
is there a way to create dynamic text that remains anti-aliased? thanks > mark -
DYNAMIC SQL SELECTION QUESTION
I posted a question earlier but that did not help me. I need to insert data from joined files A - B into C The tables are joined by the fields:... -
avail #2
Re: Dynamic Breadcrumbs question
call this php script with an include on any page which needs to show breadcrumb
as such: <p><? include('/breadcrumbgen.php'); ?>
// breadcrumbden.php
<?
/* PHP dynamic link bar script by Fran?ois Richardson. Free for use and abuse.
Makes a series of links to the web root (printed as "Home"), each folder
in the file path, and the filename. Underscores in the file names and folder
names are
shown as spaces to the visitor, and the file name is displayed without the
extension.
You can set the default web page name not to be displayed by assigning a value
to the
$def variable. I set this to "index" by default.
Making it pretty with CSS: Each link has a class="dynNav" attribute,
in case you need to apply special formatting with CSS. If you create a .dynNav
class, the formatting will override that of any A{....} tag redefinition you
do.
The padded slash following each link also has the dynNav class applied to it,
with <span> tags. If you need to apply different formatting to the links
and the slashes, create your style for the slashes as .dynNav, then override
it
for the links with an a.dynNav selector.
*/
$def = "index"; //default web page for directories on your server.
$dPath = $PHP_SELF; //Get the script path, relative to web root.
$dChunks = explode("/", $dPath); //Separate out folder and file names by
looking for slashes.
?>
<a class="dynNav" href="/">Home</a><span class="dynNav"> >> </span> <!-- make
a leading "home" link -->
<?
for($i=1; $i<count($dChunks); $i++){ //PHP arrays are 0 inxeded but we are
skipping the first element because of the way explode() works.
echo("<a class=\"dynNav\" href=\"/"); //Make each chunk a link.
for($j=1; $j<=$i; $j++){ //Subloop to create the path for each chunk.
echo($dChunks); //Write each piece of the chunk's path.
if($j!=count($dChunks)-1) echo("/");//If that piece was a folder name, append
a slash.
}
if($i==count($dChunks)-1) { //If the chunk is a file, not folder name...
$prChunks = explode(".", $dChunks); //take out the file extension...
if ($prChunks == $def) $prChunks = ""; //don't display the filename if it's
index or whatever default you specified.
$prChunks = $prChunks . "</a>"; //add the closing tag.
} else
$prChunks=$dChunks . "</a><span class=\"dynNav\"> / </span>"; //Otherwise,
just use the chunk name, close the a tag and add a paddeslash for display.
echo('\"\>');
echo(str_replace("_" , " " , $prChunks)); //Finish writing the link, replacing
underscores with spaces for the end user.
}
?>
avail Guest
-
google@impliedbydesign.com #3
Re: Dynamic Breadcrumbs question
Hello Tango,
In my opinion, how far you want to go with programming breadcrumbs
depends on what you'll be using them for. It looks like the code that
got posted earlier creates file-based breadcrumbs, so if you're looking
to illustrate a visitor's position in terms of their place in the file
structure, the code will probably work for that.
If you're looking to show a visitor's perspective in terms of site
structure, like Home > Gallery > December 5th > Photo, then it might be
easiest to make a static breadcrumb for each page. If the page itself
is dynamic, then adding breadcrumbs is as simple as adding the base
breadcrumbs, then maybe defining a variable based on the database entry
you're pulling. If you're working with a scripting language, you'll
probably figure out how to do this pretty easily.
Hope that helps.
Chris S.
Implied By Design
[url]http://www.impliedbydesign.com[/url]
Free Web Development Programs and Scripts
[url]http://www.impliedbydesign.com/free-software-scripts.html[/url]
google@impliedbydesign.com Guest



Reply With Quote

