[Power Users] Changing a Marketplace template’s default values - Salvatos/Kanka-Cookbook GitHub Wiki
So you’ve just installed a fancy character sheet from the Marketplace, but the plugin creator didn’t include default values, or not the ones you need. It’s bothersome to fill in every attribute every time you create an entity when you know some values never (or rarely) change. Can we fix this? Yes we can!
Initial setup
Let’s assume you’ve already found, installed and activated your plugin from the Marketplace. Your next step will be to create your own Attribute Template (at the bottom of your campaign’s menu).
At this stage, you don’t need to give it anything but a name, but feel free to set its other options as well.
Once saved, click the Apply an Attribute Template button in the top right.
Select the character sheet (here referred to as Marketplace Template) you will be using on your entities and click Apply.
You can see that your Attribute Template now looks the same as your actual entities would with the character sheet applied to them. It’s time to click the Manage button and edit the default attribute values to your liking.
Make sure not to change the attribute names, though! The Marketplace Template will be expecting those names. What you enter here will be the defaults for all entities you apply your Attribute Template to in the future, so you can leave in any existing defaults you like from the plugin, and erase or edit the ones you don’t. Click Save when you’re done, and the initial setup is complete!
Creating entities
Now that this is in place, creating entities with our template is going to work very slightly differently: when you Apply an Attribute Template, choose your own Attribute Template, and not the Marketplace Template. (Of course, if you’re creating a new entity and you have your attribute template set to automatically apply to newly created entities of this type via the Entity Type option, you don’t have to do anything at this step.)
Since the Marketplace Template added its _layout
attribute to your template, either of them will apply the same formatting to your entities’ attributes, but your template will have your default values. As you may have guessed, this means you can have several different Attribute Templates based on the same Marketplace Template, for various attribute presets!
You can see the result below: "My own default name/type" appear at the top of the template, but the bottom has the Marketplace Template’s placeholder text because I did not edit those fields. Everything in between is empty because neither I nor the Marketplace Template specified those values.
And now of course, as usual, you can edit the attributes on each specific entity to have all the right info! :)
If this guide helped you, a tip goes a long way to keep me making more of this kind of content :) I am also sometimes available for commissions to help directly with your templates or CSS. You can find me on Ko-fi: