Please note: I have reverted to an earlier version of my navigation system, so this post is no longer valid. The revised request has been posted and is at:
http://www.interaktonline.com/Products/Free-Products/MXBreadcrumbs/Product-Forum/Details/98915/Breadcrumbs+and+Custom+URLs+Revised+Request.html
category_ctg TABLE
-------------------------------------------------------
id_ctg name_ctg
-------------------------------------------------------
1 Jelly Beans
-------------------------------------------------------
2 Vanilla Nut Crunch Bar
-------------------------------------------------------
etc.
For my CSS M and my hyperlinks, I pull from the db like this:
SELECT *, CONCAT(REPLACE(name_ctg, ' ', '-'), '?id_ctg=', id_ctg) AS newurl FROM category_ctg
This gives me a URL of
index.php/Vanilla-Nut-Crunch-Bar?id_ctg=2
(I also pull from the name_ctg field for my page titles and menu names, etc., without the CONCAT() so they read without the '-')
But, with MX Breadcrumbs I'm limited to the way the php is hard-coded in terms of which fields are included: (id_ctg, id_parent_ctg and name_ctg)
I can succesfully use the Breadcrumbs "out-of-the-box" and end up with this URL:
index.php?id_ctg=2
My code for above looks like this:
<?php if ($totalRows_Breadcrumbs > 0) { // Show if recordset not empty ?>
> <a href="index.php?id_ctg=<?php echo $row_Breadcrumbs['id_ctg']; ?>"><?php echo $row_Breadcrumbs['name_ctg']; ?></a>
<?php } // Show if recordset not empty ?>
and while it works, it's loading a different URL than all my other menus and links.
Alternatively, I can include the catgeory_ctg.name_ctg dynamic binding like this:
<?php do { ?>
<?php if ($totalRows_Breadcrumbs > 0) { // Show if recordset not empty ?>
> <a href="<?php echo $row_Breadcrumbs['name_ctg']; ?>?id_ctg=<?php echo $row_Breadcrumbs['id_ctg']; ?>"><?php echo $row_Breadcrumbs['name_ctg']; ?></a>
<?php } // Show if recordset not empty ?>
<?php } while ($row_Breadcrumbs = mysql_fetch_assoc($Breadcrumbs)); ?>
which gives me a URL of:
index.php/Vanilla%20Nut%20Crunch%20Bar?id_ctg=9
Since I can't use CONCAT() value within my script and I can't have "%20" in my URLs, I'm trying to find a way of turning my URL into:
index.php/Vanilla-Nut-Crunch-Bar?id_ctg=2
Is there a way to include the CONCAT() function in the PHP script that's generating the URL?
I've also tried using variables in the header to call for a consistent URL, without any luck.
Thanks in advance!