<%* const placeholderPrefix = ā€œNewStarSystemā€; let title;

// 1) Prompt only if still using placeholder name if (tp.file.title.startsWith(placeholderPrefix)) { title = await tp.system.prompt(ā€œEnter Star System Nameā€); if (!title) { new Notice(ā€œNo name entered. Aborting.ā€); return; } await tp.file.rename(title); } else { title = tp.file.title; }

// 2) Gather Galaxy files from folder const galaxyFiles = tp.app.vault.getMarkdownFiles() .filter(f ⇒ f.path.startsWith(ā€œ2-World/Galaxies/ā€));

const placeholderLabel = ā€šŸŒ€ No Galaxy Selectedā€; const placeholderPath = ā€œplaceholderā€;

// 3) Prompt to choose Galaxy (or skip) const galaxyChoices = [placeholderLabel, …galaxyFiles.map(f ⇒ f.basename)]; const galaxyValues = [placeholderPath, …galaxyFiles.map(f ⇒ f.path)];

const chosenPath = await tp.system.suggester(galaxyChoices, galaxyValues, true); if (!chosenPath) return;

// 4) Build wiki-link if selected let wikiLink = null; if (chosenPath !== placeholderPath) { const chosenAlias = chosenPath.split(ā€/ā€œ).pop().replace(/.md{chosenPath}|${chosenAlias}]]`; }

// 5) Write to frontmatter setTimeout(() ⇒ { const newFile = tp.file.find_tfile(tp.file.path(true)); if (!newFile) { new Notice(ā€œCould not find file after rename.ā€); return; } app.fileManager.processFrontMatter(newFile, fm ⇒ { fm[ā€œMyContainerā€] = wikiLink ?? ā€œNoneā€; }); }, 200); %>

Parent Continent: INPUT[suggester(optionQuery(#Category/Galaxy)):MyContainer]

Column

Map

Town Name

INPUT[select(
option(1, ā„¹ļøGeneral Info),
option(2, 🌐Star System),
option(3, šŸ“GM Notes),
class(tabbed)
)]

Tabbed

NOTE

INPUT[select(
option(1, šŸ—ŗļøPlanets),
option(2, šŸ—ŗļøPoints of Interest),
class(tabbed)
)]

Tabbed


General Info

This is the star system description.

Star System Details

Dominant Races:

GM Notes

Make notes of what you need to track in the star system here.

Planets

BUTTON[button_planet]

properties:
  file.name:
    displayName: Planet Name(s)
  note.MyCategory:
    displayName: Type of Planet
views:
  - type: cards
    name: Planets - Cards
    filters:
      and:
        - file.folder == "2-World/Planets"
        - list(MyContainer).contains(this)
    order:
      - file.name
    image: note.image
  - type: table
    name: Planets - Table
    filters:
      and:
        - file.folder == "2-World/Planets"
        - list(MyContainer).contains(this)
    order:
      - file.name
    sort:
      - property: file.name
        direction: DESC
    columnSize:
      file.name: 182
 

Points of Interest

BUTTON[button_pointofinterest]

properties:
  file.name:
    displayName: Point of Interest Name(s)
  note.MyCategory:
    displayName: Type of POI
views:
  - type: cards
    name: Point of Interest - Cards
    filters:
      and:
        - file.folder == "2-World/Points of Interest"
        - list(MyContainer).contains(this)
    order:
      - file.name
    image: note.image
  - type: table
    name: Point of Interest - Table
    filters:
      and:
        - file.folder == "2-World/Points of Interest"
        - list(MyContainer).contains(this)
    order:
      - file.name
    sort:
      - property: file.name
        direction: DESC
    columnSize:
      file.name: 182