JP
  •  JP
  • 100% (Exalted)
  • YAF Leader Topic Starter
2017-01-14T18:04:45Z
This is a very basic question indeed, but I need help to make a basic custom BBCode for my forum...

I have tried myself, but since I'm too stupid to figure it out - I even managed to mess up quoting in the forum... 😊 😁

What I want to do is to refer to an external product link from a product id within the BBCode tags...

Like this:


[product]37017[/product]
Should act like:
<a href="http://www.company.com/products/lawnmowers/37017">37017</a>


The product id could be like "3701", "B126-2", "RC3514" as examples...

Any help would be very much appreciated indeed...

I have never done this, and I suck on RegEx so I would need the Search & Replace Regexes as well as additional info regarding the fields to fill in when in the Add BBcode dialog...
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Old Chinese Proverb]
Sponsor
tha_watcha
2017-01-22T01:28:24Z
The easiest way would be to check existing BB Code Extension to see how it works.

Ok what you need is

Search Regex...
\[product\](?<inner>.*?)\[/product\]


and Replace Regex

<a href="http://www.company.com/products/lawnmowers/${inner}">${inner}</a>

UserPostedImage

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved