Classified Ads: Links in Description
2 posters
Page 1 of 1
Classified Ads: Links in Description
Technical Details
Forum version : #ModernBB
Position : Founder
Concerned browser(s) : Mozilla Firefox
Who the problem concerns : All members
When the problem appeared : Since the classified ads feature was released.
Forum link : http://ztwds.forumotion.com/
Description of problem
Is there a way to add links to the description of classified ads?Re: Classified Ads: Links in Description
I think you should be able to add links using this code:
- Code:
<a href="link">Text</a>
Guest- Guest
Re: Classified Ads: Links in Description
HTML or BBCode does not work.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Classified Ads: Links in Description
I think that the description only accepts text. Fortunately, this can be changed via javascript. I cannot create ads on my forum(for reasons I'm not going to explain here), so I'll need a link from your forum where I can see the description of a classified add. It would be helpful if you would add this code to that description:
- Code:
<a href="www.google.com">Google</a>
Guest- Guest
Re: Classified Ads: Links in Description
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Classified Ads: Links in Description
Hi @SLGray,
Go to Admin Panel > Modules > JS Codes management > New
Placement : In all the pages ..? (I'm not sure if "in the topics" is applicable here)
It should automatically parse text which begins with http or https as links. If any issues, let me know.
Go to Admin Panel > Modules > JS Codes management > New
Placement : In all the pages ..? (I'm not sure if "in the topics" is applicable here)
- Code:
$(function() {
// parses hyperlinks in classified ad descriptions
for (var a = $('.AD_Description'), i = 0, j = a.length; i < j; i++) {
a[i].innerHTML = a[i].innerHTML.replace(/(http(?:s|):\/\/.*?)(\s| |<br>|$)/ig, function (match, $1, $2) {
return '<a class="AD_Description_Link" href="' + $1 + '" target="' + ( new RegExp(window.location.host).test($1) ? '_self' : '_blank' ) + '">' + $1 + '</a>' + $2;
});
}
'par ange tuteur';
});
It should automatically parse text which begins with http or https as links. If any issues, let me know.
Re: Classified Ads: Links in Description
Thanks @Ange Tuteur! It worked perfectly.
Problem solved & topic archived.
|
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» links with description
» SEO: improve your forum description and meta description
» Classified Ads
» New Classified ads widget
» Rename the portal and make it just for classified ads?
» SEO: improve your forum description and meta description
» Classified Ads
» New Classified ads widget
» Rename the portal and make it just for classified ads?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum