Highlight affiliate-links with spqr/assets and/or spqr/linker

Hello everybody,
as you may know: I am from Germany. And in Germany you can not do anything, without paying attention to the laws.
For example: If you created a little blog that contains affiliate links, you are not allowed to only link the external shop - you have to ensure that your visitors know that this is a sponsored link.
Well - I am not a lawyer, but this is the situation a lawyer explained to me.
Alright. So you need to create a little Sponsored badge or something like that, if your company (or even if you are a small startup without any employees) is located in Germany and you are using affiliate links, my article could be interesting for you.
How to start
At first, simply download spqr/assets. It's not difficult at all, but maybe check out the project page.
Now create a new asset - just like this:
Please make sure you selected:
- Status: Published
- Language: JavaScript
- Type: Save Content To File
- Filename: your-filename.js
- Require: jQuery
Now add the following content:
$("a.afl").after(" <span class='uk-badge uk-badge-notification uk-badge-success uk-icon-shopping-cart'></span>");
This is an example, that adds:
<span class='uk-badge uk-badge-notification uk-badge-success uk-icon-shopping-cart'></span>` after a link with class `afl
You can replace the HTML part with your content.
Now make sure the asset is visible on all pages.
Using spqr/linker (optional)
Of course you can spqr/linker to mask your affiliate links. You can add the class to every target - if you want to.
Using the class in posts or pages
If you don't want to use spqr/linker, you can add the class manually.
Just add the class afl
(or whatever you called it) to your links:
The result
This is the result - looks fine, huh?
Disclaimer
Please notice: I am not a lawyer. I can not guarantee that this is authorized by the law in force.
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}