Arugula

 10th March 2024 at 9:42pm

Also known as โ€œrocketโ€ or โ€œroquette,โ€ arugula is a fast-growing, cool-season leafy green that adds a tangy, mustard-like flavor to salads. Though popular on gourmet menus, itโ€™s quite easy to plant and grow arugula greens in your home garden.

Here's your information on optimal seeding density for arugula.

Code
Also known as โ€œrocketโ€ or โ€œroquette,โ€ arugula is a fast-growing, cool-season leafy green that adds a tangy, mustard-like flavor to salads. Though popular on gourmet menus, itโ€™s quite easy to plant and grow arugula greens in your home garden.

Notes

 10th March 2024 at 10:31pm

Here's a quick demo that uses fields with a View Template to automatically add tabs to tiddlers with the tag. What's the advantage of this approach?

  • You don't need to make a new tiddler for each tab. No need to clutter your wiki with Arugula/harvesting and Broccoli/harvesting; you can store the information directly in Arugula and Broccoli, where it belongs.
  • You can edit the information that gets displayed in each tab without leaving the tiddler in question, either in edit mode (as with any other field) or by using the inline editor built into the tab template.
  • Since each type of information is stored in a discrete field, it's easy to reuse later in a different format! Try using the link-to-tabs icon to access each tab on Arugula.
    • You'll see that most of the corresponding tiddlers don't exist, because they don't need to! This demo uses template=PlantTabTemplate for its <<tabs>> macro, which means that we don't have to create and populate each tab individually.
    • However, you could include whatever content you like on the tiddlers that correspond to the field/tab captions. For example, density is currently collating all the contents of the density fields on each tiddler tagged .
  • Using a View Template makes it easy to change the way information is displayed on each tiddler without editing each plant individually.
    • If you decide sometime in the future that you'd rather display these details in a tabless format, you can do just by editing PlantTabTemplate, without ever touching Arugula or Broccoli.
    • This also reduces redundant clutter on each individual tiddler: you can save the text field for unique text rather than macros and other UI elements.

All the tiddlers I used to achieve this are tagged . You can drag the tag pill into your own wiki to import all the tagged tiddlers at once. They include:

  • Visible template elements:
    • $:/my/ui/ViewTemplate/body/plant - where the <<tabs>> macro lives. Two important things to notice:
      • It has the tag, which contains all the segments that get displayed in each tiddler. You can reorder the titles in this tag-pill to change the sequence in which they're displayed.
      • It wraps all its content in the condition <% if [<currentTiddler>tag[Plant]] %>, which means that anything inside the condition will only show up on tiddlers with the tag. This prevents the template from being displayed on tiddlers where it wouldn't make sense to see it.
      • You can edit this view template to include any other standardized information you'd like to seeโ€”e.g., you could transclude another field found on tiddlers.
    • PlantTabTemplate - the template used to render each individual tab in context. The variable <<currentTab>> contains the name of the tab, which is also the name of the field used to populate it.
  • Creating a new tiddler:
    • NewPlant - the new button included in the sidebar, which creates a new tiddler with the tag, copying the fields from PlantTemplate.
      • Notice that it has the tag , which is what makes it appear with the other page controls in the sidebar. As always, you can drag and drop titles in this tag's dropdown to reorder your sidebar buttons.
    • PlantTemplate - the "placeholder" tiddler that gets cloned each time you use the button to make a new plant. All its fields (other than its tags) will get copied into each new plant you create along with their text at the time of creation.
      • You can pre-populate each field with any default content you want.
    • $:/images/templarian-material-design/sprout - the icon for the "Create a new plant" button, imported from the TW Icons collection.
  • Some more behind-the-scenes settings:
    • PlantTabs - this tiddler contains a list of field names (in title list format; I prefer lowercase field names without spaces) which will be used to generate the tabs for each .
      • It's also used in the following tiddler, which expands the listed fields into larger textboxes for ease of editing.
      • If you add fields to this list, you will likely also want to add them to PlantTemplate.
      • You can reorder the list to change the order in which the tabs appear.
    • $:/config/FieldEditorFilters/plant-tabs - part of the Field Editor cascade; this filter determines the fields that will be shown with expanding textarea editors rather than the usual single-line format.
    • $:/my/ui/EditTemplate/fieldEditor/textbox - the actual textbox that gets displayed in edit mode
  • What sort of naming scheme were you using here?
    • Not a very well-thought-out one, honestly.
      • The system tiddlers are the ones I cloned from $:/core tiddlers, replacing $:/core with $:/my to avoid confusion about their source. You might prefer to use your own namespace instead.
      • Personally, I generally prefer not to use the system prefix $:/ for my own config/UI tiddlers, as it makes them more difficult to find with a standard search. But this is really a matter of preference. If you don't want to see something in your search results, add the prefix (and any namespace/folder structure you like)!

Other plugins included in this wiki for ease of development:

Code
Here's a quick demo that uses fields with a [[View Template|https://tiddlywiki.com/#SystemTag%3A%20%24%3A%2Ftags%2FViewTemplate]] to automatically add tabs to tiddlers with the <<tag Plant>> tag. What's the advantage of this approach?

* You don't need to make a new tiddler for each tab. No need to clutter your wiki with [[Arugula/harvesting]] and [[Broccoli/harvesting]]; you can store the information directly in [[Arugula]] and [[Broccoli]], where it belongs.
* You can edit the information that gets displayed in each tab without leaving the tiddler in question, either in edit mode (as with any other field) or by using the inline editor built into the tab template.
* Since each type of information is stored in a discrete field, it's easy to reuse later in a different format! //Try using the link-to-tabs icon to access each tab on [[Arugula]].//
**  You'll see that most of the corresponding tiddlers don't exist, because they don't need to! This demo uses `template=PlantTabTemplate` for its `<<tabs>>` macro, which means that we don't have to create and populate each tab individually.
** However, you could include whatever content you like on the tiddlers that correspond to the field/tab captions. For example, [[density]] is currently collating all the contents of the `density` fields on each tiddler tagged <<tag Plant>>.
* Using a View Template makes it easy to change the way information is displayed on each tiddler //without// editing each plant individually.
** If you decide sometime in the future that you'd rather display these details in a tabless format, you can do just by editing [[PlantTabTemplate]], without ever touching [[Arugula]] or [[Broccoli]].
** This also reduces redundant clutter on each individual tiddler: you can save the text field for unique text rather than macros and other UI elements.

All the tiddlers I used to achieve this are tagged <<tag "Gardening UI">>. You can drag the tag pill into your own wiki to import all the tagged tiddlers at once. They include:

* ''Visible template elements'':
** [[$:/my/ui/ViewTemplate/body/plant]] - where the `<<tabs>>` macro lives. Two important things to notice:
*** It has the <<tag "$:/tags/ViewTemplate">> tag, which contains all the segments that get displayed in each tiddler. You can reorder the titles in this tag-pill to change the sequence in which they're displayed.
*** It wraps all its content in the [[condition|https://tiddlywiki.com/#Conditional%20Shortcut%20Syntax]] `<% if [<currentTiddler>tag[Plant]] %>`, which means that anything inside the condition will only show up on tiddlers with the <<tag Plant>> tag. This prevents the template from being displayed on tiddlers where it wouldn't make sense to see it.
*** You can edit this view template to include any other standardized information you'd like to see---e.g., you could transclude another field found on <<tag Plant>> tiddlers.
** [[PlantTabTemplate]] - the template used to render each individual tab in context. The variable `<<currentTab>>` contains the name of the tab, which is also the name of the field used to populate it.
* ''Creating a new tiddler'':
** [[NewPlant]] - the new button included in the sidebar, which creates a new tiddler with the <<tag Plant>> tag, copying the fields from [[PlantTemplate]].
*** Notice that it has the tag <<tag "$:/tags/PageControls">>, which is what makes it appear with the other page controls in the sidebar. As always, you can drag and drop titles in this tag's dropdown to reorder your sidebar buttons.
** [[PlantTemplate]] - the "placeholder" tiddler that gets cloned each time you use the button to make a new plant. All its fields (other than its tags) will get copied into each new plant you create along with their text at the time of creation.
*** You can pre-populate each field with any default content you want.
** [[$:/images/templarian-material-design/sprout]] - the icon for the "Create a new plant" button, imported from the [[TW Icons|https://morosanuae.github.io/tw-icons/]] collection.
* Some more ''behind-the-scenes'' settings:
** [[PlantTabs]] - this tiddler contains a list of field names (in [[title list|https://tiddlywiki.com/#Title%20List]] format; I prefer lowercase field names without spaces) which will be used to generate the tabs for each <<tag Plant>>.
*** It's also used in the following tiddler, which expands the listed fields into larger textboxes for ease of editing.
*** If you add fields to this list, you will likely also want to add them to [[PlantTemplate]].
*** You can reorder the list to change the order in which the tabs appear.
** [[$:/config/FieldEditorFilters/plant-tabs]] - part of the [[Field Editor cascade|$:/core/ui/ControlPanel/FieldEditor]]; this filter determines the fields that will be shown with expanding textarea editors rather than the usual single-line format.
*** Note that this needs to be //above// [[$:/config/FieldEditorFilters/default]] in the <<tag "$:/tags/FieldEditorFilter">> tag, since [[cascades|https://tiddlywiki.com/#Cascades]] apply the first matching result.
*** works in conjunction with the following:
** [[$:/my/ui/EditTemplate/fieldEditor/textbox]] - the actual textbox that gets displayed in edit mode
* //What sort of naming scheme were you using here?//
** Not a very well-thought-out one, honestly.
*** The system tiddlers are the ones I cloned from $:/core tiddlers, replacing $:/core with $:/my to avoid confusion about their source. You might prefer to use your own namespace instead.
*** Personally, I generally prefer //not// to use the system prefix `$:/` for my own config/UI tiddlers, as it makes them more difficult to find with a standard search. But this is really a matter of preference. If you don't want to see something in your search results, add the prefix (and any namespace/folder structure you like)!

''Other plugins included in this wiki'' for ease of development:

* [[Link to Tabs|$:/plugins/wikilabs/link-to-tabs]]
* [[Relink|$:/plugins/flibbles/relink]]
* [[Side Editor|$:/plugins/TWaddle/SideEditor]]
* [[Utility|$:/plugins/kookma/utility]]