I have not learned how to use this yet, but it introduces real possibilities of crafting great landing pages for public wikis, good start pages and more.
That’s a nice idea. In the “Settings” (gear) popup I have added a “chevron-down” button that gives you a drop-down $select list of preset grid sizes to choose from. This list is populated from the contents of $:/config/TiddlyTools/PasteUp/Sizes, which currently has the following lines, where the format of each line is “gridwidth,gridheight|description”
34,44|US letter (8.5in x 11in)
34,56|US legal (8.5in x 14in)
42,60|A4 (210mm x 297mm)
20,20|square (1:1)
30,20|photo (3:2)
32,18|wide (16:9)
By using a separate configuration tiddler, it enables you to edit the list to add your own preferred preset grid sizes.
While testing the Settings popup grid size inputs, I accidentally entered a width of “5000” instead of “50” (due to a “keybounce”). The result was that the code attempted to render a layout grid containing 5000 x 30 $button widgets (that’s 150,000 buttons!), which immediately “bricked” my TiddlyWiki
To prevent this, I’ve added code in layout_grid() that limits the width/height values to a minimum of 10 and a maximum of 100 in each dimension, regardless of the values entered in the Settings popup.
This permits up to 10,000 $button widgets (100x100) in the layout grid. While this can still cause a processsing slowdown, it seems like a reasonable solution to prevent a full “brick” from occurring.
These limits are currently hard-coded; should they be configurable?
Can you think of a situation where you would want less than 10 or more than 100 grid buttons in either dimension?
Page size presets $select widget has been enhanced:
In addition to listing preset page sizes, it now also includes an “edit list…” item (at the bottom of the list). When you select this item, instead of setting the layout width and height values, it navigates to $:/config/TiddlyTools/PasteUp/Sizes and opens it for editing.
Update to TiddlyTools/PasteUp and $:/config/TiddlyTools/PasteUp/Sizes:
The “Settings” page size preset $select list shows the full text of each line from the $:/config/TiddlyTools/PasteUp/Sizes tiddler, and the format used to specify the width and height have changed so that it is now clear what width and height values are used for each preset.
34 x 44 = US letter (portrait)
44 x 34 = US letter (landscape)
34 x 56 = US legal (portrait)
56 x 34 = US legal (landscape)
42 x 60 = A4 (portrait)
60 x 42 = A4 (landscape)
20 x 20 = square (1:1)
30 x 20 = photo (3:2)
32 x 18 = wide (16:9)
Bacause of the complexity of tracking up to five changes I decided to …
only have REVERT LAST change (based on your code)
and offer RESTORE ALL. Which simply overwrites /Layout with a previously saved backup to restore the starting point.
What do you think? Okay?
Of course now I have to figure out how to individually set Z-INDEX for fields because my layout above can end up with, for example, two overlapping fields with identical Z-Index of 2—with unpredictable results.
Anyway. It’s going well. I could not have got here without your help!
Thanks, TT