Hello,

I'm trying to achive something, and can't find the solution, maybe this will turn out to be a feature request... but anyway...

I'm creating a breadcrumb for a view, the user arrives on this page after clicking an item inside a jquery ui tab system, in the title section I'm using this:

Item1
Item2
[arg2]
[arg3]

and in the path section this:

item1
item1/item2
item1/item2/[arg2]
item1/item2/[arg2]#[arg3]

The problem is I can't escape the # in the url, it shows up has %23, I've tried using \ and '' but it didn't work. The url is saved has is in the DB, so I'm guessing it's changing when called.

The reason I'm trying to to this is so that when the user navigates using the breadcrumb, to the previous page, they go to the correct tab.
Is this possible? If not, I'll change this to a feature request.

Thanks!

CommentFileSizeAuthor
#2 483060_fragment.diff1.71 KBMGN

Comments

jolidog’s picture

Component: Documentation » Miscellaneous

Assigning this to miscellaneous.

MGN’s picture

Title: escaping # in the path section » Allow for named anchors in breadcrumb paths
Component: Miscellaneous » Code
Assigned: Unassigned » MGN
Category: support » feature
Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new1.71 KB

I don't know of a way to prevent the link function from mangling the # sign, but there is a way to separately specify a named anchor. This patch modifies _custom_breadcrumb_create_crumb() to look for a named anchor in a path, strip it out, and correctly pass it as an option to the link function.

I think this will do what you are looking for. I don't anticipate any problem with this modification, since this is the only reason (that I can imagine) why # would appear in a url....why not render it correctly?

Can you test it out and confirm that it works as expected, (and that it doesn't comprise any other functionality :) )

jolidog’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Hello,

I installed the patch, it works great. Everything else continued to work as before.
Thank you very much!

In the next few moths I'll start working on another project, where I'm planning on using CB for nodes, taxonomies and views, so I'll be able to test module in a more complete way.

Thanks again!

jolidog’s picture

Since posting the previous reply I continued working with jquery, learning in particular the options of the tab plugin.
I found out there is an option to set a cookie to remember the last tab visited, it involves installing another jquery plugin called cookie and setting some options.

Setting the cookie solves my problem, not needing the named anchor in the path, it's visually cleaner, although it's another cookie for the user, I set it to expire in 1 day.
So I'm affraid I might have wasted your time with this request. Sorry.

I leave it to you to decide if you leave the code supporting the # or not. In my opinion, I think CB should suport it since it's something that might come up in the future and works without special javascript/cookies enabled. On the other hand maybe this will complicate the future development of the module.

Again, I'm sorry, but also very greatfull for your quick reply and fix.

MGN’s picture

Status: Reviewed & tested by the community » Fixed

No problem. I agree that its better to handle these types of paths for the reasons mentioned above. Committed for further testing http://drupal.org/cvs?commit=223292

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.