Difference between revisions of "Extensions:Sales Widget"
(Finally making a wiki page for the Sales Widget) Tag: 2017 source edit |
m (Adding images...) Tag: 2017 source edit |
||
| Line 1: | Line 1: | ||
| − | {{Extensioninfobox|title= | + | {{Extensioninfobox|title=Sales Widget|desc=A widget that displays the most recent sales posts.|auth=Min|status=Stable|github={{Github|user=liwoyadan|branch=extension/sales-widget}}|LKVer=3.0.0|migration=no|package=no}} |
Displays a widget on the logged-in dashboard that will show the most recently created/updated sales posts. By default the widget displays the two most recent sales posts but can be configured for more or less. | Displays a widget on the logged-in dashboard that will show the most recently created/updated sales posts. By default the widget displays the two most recent sales posts but can be configured for more or less. | ||
| Line 10: | Line 10: | ||
To configure how many sales are displayed, in <code>app\Http\Controllers\HomeController.php</code> in the first function in the file edit the '2' in <code>'saleses' => Sales::visible()->orderBy('id', 'DESC')->take(2)->get(),</code> to however many news you'd like to be displayed. | To configure how many sales are displayed, in <code>app\Http\Controllers\HomeController.php</code> in the first function in the file edit the '2' in <code>'saleses' => Sales::visible()->orderBy('id', 'DESC')->take(2)->get(),</code> to however many news you'd like to be displayed. | ||
The widget itself can be edited and styled in <code>resources\views\widgets\_sales.blade.php</code>. | The widget itself can be edited and styled in <code>resources\views\widgets\_sales.blade.php</code>. | ||
| − | |||
| − | |||
== Images == | == Images == | ||
| − | + | <gallery> | |
| + | File:Sales_Widget_(Two_Posts).png|alt=A Lorekeeper dashboard with a widget titled 'Recent Sales', displaying two recent sales - one text only and the other with a character.|The sales widget on the dashboard displaying the two most recent sales posts, one that is text-only and another that is a flatsale with a preview of one of the characters. | ||
| + | File:Sales_Widget.png|alt=A Lorekeeper dashboard with a widget titled 'Recent Sales', displaying a single recent flatsale.|The sales widget on the dashboard displaying a single recent flatsale, previewing one of the characters attached. | ||
| + | </gallery> | ||
== Troubleshooting == | == Troubleshooting == | ||
| − | |||
I can be found in the Lorekeeper server. | I can be found in the Lorekeeper server. | ||
== See Also == | == See Also == | ||
| − | + | - [[Extensions:Sales Image]] | |
Revision as of 03:20, 10 May 2025
| Description | A widget that displays the most recent sales posts. |
|---|---|
| Author(s) | Min |
| Status | Stable |
| Github | extension/sales-widget |
| LK Version | 3.0.0 |
Displays a widget on the logged-in dashboard that will show the most recently created/updated sales posts. By default the widget displays the two most recent sales posts but can be configured for more or less.
The widget is called with @include('widgets._sales') and can be used elsewhere (i.e. in a sidebar) as long as the $saleses variable (by default in HomeController) is declared on respective pages.
Installation
Pull the branch; resolve any conflicts if necessary. There are no migrations in this extension. If you are looking for the old v2 version from ~2 years back, you can grab it from the ext/sales-widget branch sitting on my repo.
Configuration
To configure how many sales are displayed, in app\Http\Controllers\HomeController.php in the first function in the file edit the '2' in 'saleses' => Sales::visible()->orderBy('id', 'DESC')->take(2)->get(), to however many news you'd like to be displayed.
The widget itself can be edited and styled in resources\views\widgets\_sales.blade.php.
Images
Troubleshooting
I can be found in the Lorekeeper server.