Widget:Bookshop: Difference between revisions
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<div class="bookshop-widget-container" id="bookshop-widget-{ | <div class="bookshop-widget-container" id="bookshop-widget-<!--{$id|default:'default'|escape:'html'}-->"> | ||
<script src="https://bookshop.org/widgets.js" | <script async src="https://bookshop.org/widgets.js" | ||
data-type="{ | data-type="<!--{$style|default:'book'|escape:'html'}-->" | ||
data-affiliate-id="{ | <!--{if $style == 'featured'}-->data-full-info="true"<!--{/if}--> | ||
data-sku="{ | data-affiliate-id="<!--{$affiliate|default:'111716'|escape:'html'}-->" | ||
data-sku="<!--{$sku|escape:'html'}-->"> | |||
</script> | </script> | ||
<noscript> | |||
<a href="https://bookshop.org/books/isbn/<!--{$sku|escape:'url'}-->" target="_blank"> | |||
View book on Bookshop.org | |||
</a> | |||
</noscript> | |||
</div> | </div> | ||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude> | ||
This widget embeds a Bookshop.org book widget on a wiki page with different style options. | |||
This widget embeds a Bookshop.org book widget on a wiki page. | |||
=== Usage === | === Usage === | ||
<pre> | <pre> | ||
{{widget: | {{#widget:Bookshop | ||
| | |style=featured | ||
| | |sku=9780062316110 | ||
|affiliate=111716 | |affiliate=111716 | ||
| | |id=my-book-1 | ||
}} | }} | ||
</pre> | </pre> | ||
=== Parameters === | === Parameters === | ||
* | * style (optional): Display style - one of: "book" (default), "featured", "buy", or "list" | ||
* | * sku (required): The book's ISBN/SKU number (example: 9780062316110) | ||
* affiliate (optional): Your Bookshop.org affiliate ID (default: 111716) | * affiliate (optional): Your Bookshop.org affiliate ID (default: 111716) | ||
* | * id (optional): A unique identifier for this widget instance (default: "default") | ||
=== Troubleshooting === | |||
* If the widget shows "Not Found", verify that the ISBN/SKU is correct and available on Bookshop.org | |||
* Some ad blockers may interfere with the widget's functionality | |||
</noinclude> | </noinclude> |
Latest revision as of 17:06, 10 March 2025
This widget embeds a Bookshop.org book widget on a wiki page with different style options.
Usage
{{#widget:Bookshop |style=featured |sku=9780062316110 |affiliate=111716 |id=my-book-1 }}
Parameters
- style (optional): Display style - one of: "book" (default), "featured", "buy", or "list"
- sku (required): The book's ISBN/SKU number (example: 9780062316110)
- affiliate (optional): Your Bookshop.org affiliate ID (default: 111716)
- id (optional): A unique identifier for this widget instance (default: "default")
Troubleshooting
- If the widget shows "Not Found", verify that the ISBN/SKU is correct and available on Bookshop.org
- Some ad blockers may interfere with the widget's functionality