Tables can add their own class with a line like:
|firstclass secondclass|k
at the start.
If you define classes for each color you will be using, and wrap your table
using a macro (so you can pass it a class name), then something like this:
\define mytable(colorclass)
|persontable $colorclass$|k
|>| @@display:block;width:23em;<div class="lightgrey">''[Tiddler-specific
title]''</div>@@ |
|^@@display:block;width:6.5em; ''Value 1'' @@
|@@display:block;width:15em;{{!!value1}}@@ |
|^@@display:block;width:6.5em;''Value 2''@@ |@@display:block;width:15em;@@ |
|^@@display:block;width:6.5em;''Value 3''@@ |@@display:block;width:15em;@@ |
\end
<$macrocall $name="mytable" colorclass={{!!tablecolor}}/>
Can be used as a template, where the name of the class is stored in the
field "tablecolor" (which I suppose should become "tableclass", but oh
well).
I don't know if there is a way to trigger actions when a tiddler is opened.
Maybe someone else can answer that.
I would tend to use the technique described here:
https://tiddlywiki.com/#WidgetMessage%3A%20tm-new-tiddler
or here:
https://tiddlywiki.com/#ActionCreateTiddlerWidget
to create the new tiddlers with all fields added.
-- Mark
On Friday, October 12, 2018 at 12:44:29 AM UTC-7, Rafael Aprato wrote:
>
> Hey Mark,
>
> Thank you for the help! It definitely helped me make some sense of it, and
> I'm now very close to my ideal result. The values I wanted to input were
> the ones of the second column, not the first, like so:
>
> |^@@display:block;width:6.5em;''Value 1''@@ |@@display:block;width:15em;
> {{!!value1}}@@ |
>
> So now the first column has "Value 1" in bold in every table, and the
> second one has the value I input in the fields under the tiddler edit. I
> also managed to make the input bold if I want to, like this:
>
> |^@@display:block;width:6.5em;''Value 1''@@ |@@display:block;width:15em;''
> {{!!value1}}''@@ |
>
> But I still have some issues...forgive me if I pester you for a bit longer.
>
> - Is there a way to add dozens of fields to a new tiddler (with blank
> values) with a single tag? My tables are pretty big, it would make quite a
> difference. I've read about the <$button> widget and I guess I could have
> one in the Home tiddler making it so that it would create a new tiddler
> with the tags needed, but it's important that new pages are created when
> clicking in missing links in other tiddlers. I imagine tags are the way to
> do what I want, but google isn't helping me here.
>
> - Any way to make this work with the cell background color? It would avoid
> having to create a template for every color I need to use. In my mind, it
> would work by having this in the template:
>
> |>| @@display:block;width:23em;<div class= "{{!!tablecolor}}">''{{!!
> tablename}}''</div>@@ |
>
> And then "lightgrey" in a "tablecolor" field in "Person 1", but it doesn't
> change anything, and the cell comes out with default background color (note
> that lightgrey is already defined in the Stylesheet). Tried including
> different parts of the div class in the {{!!}} and writing them in the
> field, and no deal. Maybe it's possible to link it to the "color" default
> field, or to a tag?
>
> Thank you for taking time to help me out.
>
> Cheers,
>
> Rafael
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/0bb8d4df-2ef5-4979-b2d7-9b54db372a19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.