Difference between revisions of "Extensions:Random Spotlight"
m (Mentioned Featured Character) Tag: 2017 source edit |
(Changed branch name) |
||
(18 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{Extensioninfobox|title=Random Spotlight|desc=Add a sidebar to your frontpage showing a random design!|auth=[[User:Speedy|Speedy]]|status=stable|github={{Github|user=SpeedyD|branch=extension/random-spotlight}}|LKVer=2.1.0|migration=no|package=no}} | + | {{Extensioninfobox|title=Random Spotlight|desc=Add a sidebar to your frontpage showing a random design!|auth=[[User:Speedy|Speedy]]|status=stable|github={{Github|user=SpeedyD|branch=extension/random-spotlight-2.1 |
+ | }}|LKVer=2.1.0|migration=no|package=no}} | ||
− | This extension adds a sidebar to your frontpage.. showing a random character from all of your site's species! | + | {| style="margin: 4px auto; width: 80%; border: 1px solid #940a0a; background: #C8D945;" |
+ | |- | ||
+ | | '''<u>THIS EXTENSION IS NOT YET UPDATED FOR LK v3.0.0</u>''' | ||
+ | |- | ||
+ | | You should be fine to use this extension while still on v2.1.0 and upgrading from there. | ||
+ | |} | ||
+ | |||
+ | This extension adds a sidebar to your frontpage.. showing a random character from each of all of your site's species! | ||
The purpose of this extension is basically to give users an easy way to find a character to make gift work for! :) | The purpose of this extension is basically to give users an easy way to find a character to make gift work for! :) | ||
Line 7: | Line 15: | ||
(Please note that characters will only be shown if they have <u>at minimum</u> "Please Ask" for either Gift Art or Gift Writing.) | (Please note that characters will only be shown if they have <u>at minimum</u> "Please Ask" for either Gift Art or Gift Writing.) | ||
− | '''This extension is built off of v2.1.0 and will not be updated until | + | '''This extension is built off of v2.1.0 and will not be updated for a higher LK version until v3.0.0's release. Thank you.''' |
== Installation == | == Installation == | ||
Pull the extension branch and push to your site. That's it! | Pull the extension branch and push to your site. That's it! | ||
− | Don't forget to run <code>php artisan update-extension-tracker | + | Don't forget to run <code>php artisan update-extension-tracker</code>! |
+ | |||
== Configuration == | == Configuration == | ||
No configuration necessary. | No configuration necessary. | ||
Line 23: | Line 32: | ||
This is not a requirement, but by default, the species with id 1 will be displayed openly, while the other species will be behind a closed accordion-styled collapse menu. | This is not a requirement, but by default, the species with id 1 will be displayed openly, while the other species will be behind a closed accordion-styled collapse menu. | ||
+ | |||
== Usage == | == Usage == | ||
If you already have a sidebar on your frontpage, you may want to pass on this extension unless you are positive on how to edit it in yourself. | If you already have a sidebar on your frontpage, you may want to pass on this extension unless you are positive on how to edit it in yourself. | ||
I will '''<u>not</u>''' provide support for conflicting extensions in this manner. | I will '''<u>not</u>''' provide support for conflicting extensions in this manner. | ||
+ | |||
== Troubleshooting == | == Troubleshooting == | ||
− | + | Create a new thread in the #general-help channel of the Discord! | |
− | + | You can always try tagging me (see my [[User:Speedy|user page]]), as I'm semi-active on the server, but a new thread is your best bet. | |
− | |||
== Images == | == Images == | ||
<!-- Note to self: add images sometime soon --> | <!-- Note to self: add images sometime soon --> | ||
+ | |||
+ | == Version History == | ||
+ | * '''1.0.0:''' Initial creation. | ||
+ | * '''1.0.1:''' Removed code for Character Titles section- admittedly, forgot it was in there. You can re-add it with the code in the See Also section. | ||
+ | * '''1.0.2:''' Fix to collapse menus, with thanks to [[User:CH3RVB]]- it's set to id, so species with spaces or other changes will now also work. | ||
+ | * '''1.0.3:''' Hidden species is a dev branch or LK v3.0.0 feature. As such, this caused errors. My bad. =_=;; | ||
+ | * '''1.0.4:''' Turns out the default is to ''include'' past images. It's now filtered to latest only. | ||
+ | |||
== See Also == | == See Also == | ||
+ | This extensions works well with [[Extensions:Character_Titles]]. (In fact, I may have previously forgotten to remove the code.. =_=;;..) | ||
+ | |||
+ | Simply add a new line at line 13 of <code>resources/views/frontpage/_sidebar.blade.php</code> and add the following code: | ||
+ | <syntaxhighlight lang="php"> | ||
+ | <div class="small mb-1"> | ||
+ | @if(Settings::get('character_title_display') && $character->image->hasTitle) | ||
+ | {!! $character->image->title_id ? $character->image->title->displayNameShort : (isset($character->image->title_data['short']) ? nl2br(htmlentities($character->image->title_data['short'])) : nl2br(htmlentities($character->image->title_data['full']))) !!} | ||
+ | @else | ||
+ | | ||
+ | @endif | ||
+ | </div> | ||
+ | </syntaxhighlight> | ||
+ | (This should be in between the section that has <code>{!! $character->displayOwner !!}</code> in it, and the section that has <code>{{ $character->is_gift_art_allowed</code> in it.) | ||
+ | |||
+ | ----- | ||
This extension conflicts with [[Extensions:Featured_Character]]. But done right, you could add this extension alongside it. | This extension conflicts with [[Extensions:Featured_Character]]. But done right, you could add this extension alongside it. | ||
Simply edit <code>resources/views/welcome.blade.php</code> to have both @includes for the sidebar in a single sidebar section. If you do not know how to do that, please do not attempt it. | Simply edit <code>resources/views/welcome.blade.php</code> to have both @includes for the sidebar in a single sidebar section. If you do not know how to do that, please do not attempt it. |
Latest revision as of 02:04, 19 March 2024
Description | Add a sidebar to your frontpage showing a random design! |
---|---|
Author(s) | Speedy |
Status | stable |
Github | extension/random-spotlight-2.1 |
LK Version | 2.1.0 |
THIS EXTENSION IS NOT YET UPDATED FOR LK v3.0.0 |
You should be fine to use this extension while still on v2.1.0 and upgrading from there. |
This extension adds a sidebar to your frontpage.. showing a random character from each of all of your site's species!
The purpose of this extension is basically to give users an easy way to find a character to make gift work for! :)
(Please note that characters will only be shown if they have at minimum "Please Ask" for either Gift Art or Gift Writing.)
This extension is built off of v2.1.0 and will not be updated for a higher LK version until v3.0.0's release. Thank you.
Contents
Installation
Pull the extension branch and push to your site. That's it!
Don't forget to run php artisan update-extension-tracker
!
Configuration
No configuration necessary.
However, if, for any reason, your main species is not id 1, please go to resources/views/frontpage/_sidebar.blade.php
.
and look for species->id == 1
as well as species->id != 1
(on lines 5 and 6).
Change the 1
to the actual number of your main species.
This is not a requirement, but by default, the species with id 1 will be displayed openly, while the other species will be behind a closed accordion-styled collapse menu.
Usage
If you already have a sidebar on your frontpage, you may want to pass on this extension unless you are positive on how to edit it in yourself.
I will not provide support for conflicting extensions in this manner.
Troubleshooting
Create a new thread in the #general-help channel of the Discord!
You can always try tagging me (see my user page), as I'm semi-active on the server, but a new thread is your best bet.
Images
Version History
- 1.0.0: Initial creation.
- 1.0.1: Removed code for Character Titles section- admittedly, forgot it was in there. You can re-add it with the code in the See Also section.
- 1.0.2: Fix to collapse menus, with thanks to User:CH3RVB- it's set to id, so species with spaces or other changes will now also work.
- 1.0.3: Hidden species is a dev branch or LK v3.0.0 feature. As such, this caused errors. My bad. =_=;;
- 1.0.4: Turns out the default is to include past images. It's now filtered to latest only.
See Also
This extensions works well with Extensions:Character_Titles. (In fact, I may have previously forgotten to remove the code.. =_=;;..)
Simply add a new line at line 13 of resources/views/frontpage/_sidebar.blade.php
and add the following code:
<div class="small mb-1">
@if(Settings::get('character_title_display') && $character->image->hasTitle)
{!! $character->image->title_id ? $character->image->title->displayNameShort : (isset($character->image->title_data['short']) ? nl2br(htmlentities($character->image->title_data['short'])) : nl2br(htmlentities($character->image->title_data['full']))) !!}
@else
@endif
</div>
(This should be in between the section that has {!! $character->displayOwner !!}
in it, and the section that has {{ $character->is_gift_art_allowed
in it.)
This extension conflicts with Extensions:Featured_Character. But done right, you could add this extension alongside it.
Simply edit resources/views/welcome.blade.php
to have both @includes for the sidebar in a single sidebar section. If you do not know how to do that, please do not attempt it.