Support Forum
No, that's the wrong one. Look at end of function - same name but without 'args' in name.
This filter will give you the display code before it's echoed out.
You can thus change it before displayed. In this case you would want to replace the image tags with straight text/problem-with-post-edit-buttontml, likely with a preg_replace() call.
As I said, in this case it's a bit harder and needs php code. I suspect you could Google how to replace img tags with text and find it. As I am away from computer until evening I cannot look up the regex until then.
You could directly edit the function more easily but would lose changes on next upgrade.
Visit Cruise Talk Central and Mr Papa's World
I've had my first turn of luck with this code in my themes spFunctions.php:
function BreadCrumb_Divider_Replace ($breadCrumbs) { $icon_replace_with = " → "; $breadCrumbs = preg_replace('/<img[^>]+>/i', $icon_replace_with, $breadCrumbs); return $breadCrumbs; } add_filter('sph_BreadCrumbs', 'BreadCrumb_Divider_Replace');
The arrows though becomes a part of the links, and there is no spacing, so that's the next thing I need to figure out. it looks like this:
And the generated HTML:
<div id="spBreadCrumbs" class="spBreadCrumbs"> <a class="spLink" href="http://spv2.omkalfatring.dk/"> → Hjem</a><a class="spLink" href="http://spv2.omkalfatring.dk/forum/"> → Forum</a><a class="spLink" href="http://spv2.omkalfatring.dk/forum/okonomi/"> → Økonomi</a></div>
cant see all the code in the email on my phone, but looks like your preg_replace might be replace more than just img tags??
will look closer this evening when home if you dont figure it out...
Visit Cruise Talk Central and Mr Papa's World
Well, the current code in sp-common-view-functions.php places the breadcrumb icon HTML inside the links, so any replacement will also be put there.
My solution for now is:
1) Remove the images from the breadcrumb with the filter (slightly adjusted):
function BreadCrumb_Divider_Replace ($breadCrumbs) { $icon_replace_with = ""; $breadCrumbs = preg_replace('/<img[^>]+>/i', $icon_replace_with, $breadCrumbs); return $breadCrumbs; } add_filter('sph_BreadCrumbs', 'BreadCrumb_Divider_Replace');
2) Edit lines 1238, 1255, 1265, 1274 and 1280 of sp-common-view-functions.php, placing the → HTML entities in the link code there.
I know 2 is not upgrade-safe, but it's an okay solution for now. After an upgrade it would not take long to correct the code.
Still, I would appreciate the possibility to add the arrows as a divider-argument in sp_BreadCrumbs().
so if I understand, you are good for now?
As I said, we hope to implement the ticket for allowing text (or html entity) as the separator in the next version...
Visit Cruise Talk Central and Mr Papa's World
Jakob Smith said
Well, the current code in sp-common-view-functions.php places the breadcrumb icon HTML inside the links, so any replacement will also be put there.My solution for now is:
1) Remove the images from the breadcrumb with the filter (slightly adjusted):
function BreadCrumb_Divider_Replace ($breadCrumbs) { $icon_replace_with = ""; $breadCrumbs = preg_replace('/<img[^>]+>/i', $icon_replace_with, $breadCrumbs); return $breadCrumbs; } add_filter('sph_BreadCrumbs', 'BreadCrumb_Divider_Replace');
2) Edit lines 1238, 1255, 1265, 1274 and 1280 of sp-common-view-functions.php, placing the → HTML entities in the link code there.
I know 2 is not upgrade-safe, but it's an okay solution for now. After an upgrade it would not take long to correct the code.
Still, I would appreciate the possibility to add the arrows as a divider-argument in sp_BreadCrumbs().
I've had to go back to this problem, because my edits in 2) above was overwritten without my knowledge on a clients site.
Referring to the above, has there been any change over the past 11 months which makes it possible for me to put in a divider, which doesn't become part of the links in the breadcrumb?
I have looked here without any luck:
You should be able to turn off the icon images and add text to be shown instead.
I have not tested but would try something like this.
sp_BreadCrumbs('tagClass=spLeft spBreadCrumbs&tree=1&homeIcon=&icon=&;iconText=→', __sp('Home'));
I tried something very close to that, but my problem is that the right arrow becomes part of the link, like in my old post and that doesn't look good when you are displaying breadcrumbs inline.
I would really like the possibility of doing the breadcrumb like this, without editing core files:
Home → Breadcrumb → Breadcrumb
Now, with the above code, I'm getting this: