Extensions:Random Spotlight

From Lorekeeper Wiki
Revision as of 18:25, 12 April 2023 by Speedy (talk | contribs) (Add suggestion for Character Titles)
Jump to navigation Jump to search
Random Spotlight
Description Add a sidebar to your frontpage showing a random design!
Author(s) Speedy
Status stable
Github extension/random-spotlight
LK Version 2.1.0






This extension adds a sidebar to your frontpage.. showing a random character from 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 until 3.0.0's release. Thank you.

Installation

Pull the extension branch and push to your site. That's it!

Don't forget to run php artisan update-extension-tracker and php artisan optimize!

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

I'm Speedy#4060 on Discord, but please do not contact me directly.

Instead, please tag me in the Lorekeeper server if you need my help.

I am not a regular there, so asking something without a tag might not get a response.

Images

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: <syntaxhighlight lang="php">

               @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

<syntaxhighlight lang="php"> (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.