I saw this post over at vB.org and I was wondering what Search JSON I can use to get this working for vB5?
Announcement
Collapse
No announcement yet.
#Hashtag BBCode
Collapse
X
-
Try:
HTML Code:<a href="/search?q={param}">#{param}</a>
Alternative solution is to use Javascript.
HTML Code:<span data-p="{param}"></span> <script> (function() { var me = document.currentScript || (function() { var s= document.getElementsByTagName( 'script' ); return s[s.length - 1]; })(); if (me) { var span = me.previousElementSibling; var param = span.getAttribute('data-p'); span.innerHTML = '<a href="' + pageData.baseurl + '/search?q=' + encodeURIComponent(param) + '">#' + param + '</a>'; } })(); </script>
Helpful? Donate. Thanks!
Fast VPS Host for vBulletin:
A2 Hosting & IONOS
- Top
- Translate
- Bottom
- Likes 1
-
AdminCP > Custom BB Codes > Add New BB Code. The code above goes to Replacement field.Helpful? Donate. Thanks!
Fast VPS Host for vBulletin:
A2 Hosting & IONOS
- Top
- Translate
- Bottom
- Likes 1
Comment
-
Originally posted by glennrocksvbDid you test search keywords with spaces, special characters (?, & and %) and accents? Try in different browsers.- When entering multiple keywords, it only shows results for the first keyword
- Special characters are working
- Accents will give the message that your criteria is not restrictive enough
- Top
- Translate
- Bottom
- Likes 1
Comment
-
So you're adding this HTML code in the Replacement field for the custom BBCode you are creating and you got an error when saving it?
Code:<a href="/search?q={param}">#{param}</a>
Helpful? Donate. Thanks!
Fast VPS Host for vBulletin:
A2 Hosting & IONOS
- Top
- Translate
- Bottom
Comment
-
Creating another reply because this is front-end discussion ..
At the front end, it does not work
When I add a hashtag to a post, it does show #item with a link on it but the link shows http://www.site.com/search?q=
No parameters. It should rather show http://www.site.com/search?q=item
Please advise. Thanks!
- Top
- Translate
- Bottom
Comment
-
It ultimately does not work as the double quotes are in the wrong places. Keep the original code and just click the Continue button when the error message appears and see what happens.Helpful? Donate. Thanks!
Fast VPS Host for vBulletin:
A2 Hosting & IONOS
- Top
- Translate
- Bottom
- Likes 1
Comment
Users Viewing This Page
Collapse
There is 1 user viewing this forum topic.
- Guest
Latest Posts
Collapse
Comment