[TW5] Creating an alternative Edit template

112 views
Skip to first unread message

Danielo Rodríguez

unread,
Sep 28, 2015, 6:16:04 PM9/28/15
to TiddlyWiki
Hello Everyone,

I'm trying to build an alternative Edit template, and I'm having the same kind of issues that I always have: transclusions.

I want to have a "main" tiddler that transcludes all the parts. The "main" tiddler looks like this:

<$tiddler tiddler={{$:/state/OTW/editedTiddler}}>
<$list filter="[all[shadows+tiddlers]tag[$:/OTW/Editor]!has[draft.of]]" variable="listItem">
<$transclude tiddler=<
<listItem>>/>
</$list>
</$tiddler>


Then, on one of the transcluded tiddlers I have this code:

<div class="tc-tiddler-title">
   
<div class="tc-titlebar">
               
<h2 class="tc-title">

                 <$view field="otw-alias"/>
               
</h2>
   
</div>

</div

>

What I want is to "point" one state tiddler to a tiddler title and then edit that "pointed" tiddler.

I don't understand why, but the view field is not showing any value. Other similar tiddlers are working well, but not for "custom" fields but for standard fields like title. Could it be related?
I have to admit that transclusions on TW can be tricky and frustrating, even for someone with some experience with TW. I tried testing the <<currentTiddler>> variable on the transcluded tiddler and it has the expected value.

Any help would be appreciated.
Many thanks.

Tobias Beer

unread,
Sep 29, 2015, 1:23:29 AM9/29/15
to tiddl...@googlegroups.com
Hi Danielo,

I believe you may have copy-pasted that from somewhere.
Remove the listItem variable and have your list iteration
always point to the list item as the currentTiddler.
Then your view widget knows what tiddler
you're actually talking about...

<$tiddler tiddler={{$:/state/OTW/editedTiddler}}>
<$list filter="[all[shadows+tiddlers]tag[$:/OTW/Editor]!has[draft.of]]">
<$transclude/>
</$list>
</$tiddler>

Best wishes,

— tb

Danielo Rodríguez

unread,
Sep 29, 2015, 2:57:22 AM9/29/15
to TiddlyWiki


El martes, 29 de septiembre de 2015, 7:23:29 (UTC+2), Tobias Beer escribió:
Hi Danielo,

I believe you may have copy-pasted that from somewhere.
Remove the listItem variable and have your list iteration
always point to the list item as the currentTiddler.
Then your view widget knows what tiddler
you're actually talking about...

If I do that, then I will loose the currenTiddler that I actually want, which is the tiddler pointed by the state tiddler. In any case, it is working right now, and the code is the same, so probably the problem was at other point. Thank you for your time in any case.
Just to be clear Tobias, the variable of the list widget is essential to keep the scope that I need.

Regards.

Tobias Beer

unread,
Sep 29, 2015, 6:49:43 AM9/29/15
to tiddl...@googlegroups.com
Hi Danielo,
 
Just to be clear Tobias, the variable of the list widget is essential to keep the scope that I need.

Ok, just forget my last post, it was rubbish. :D
Didn't quite get that you were looking up
from a number of possible templates in the inner list.
I really have to look a little closer
when I see something like listItem being used.

~

It's a bit hard to imagine the possible problems without looking at some MTC.

You could have...

  1. forgotten to give the tiddler referenced in $:/state/OTW/editedTiddlera field called "otw-alias"
  2. forgotten to give the second tiddler the tag $:/OTW/Editor
  3. given the second tiddler the tag $:/tags/EditTemplate instead of the first one
  4. etc...
Best wishes,

— tb

Danielo Rodríguez

unread,
Sep 29, 2015, 9:20:13 AM9/29/15
to TiddlyWiki
Ok, just forget my last post, it was rubbish. :D
Didn't quite get that you were looking up
from a number of possible templates in the inner list.
I really have to look a little closer
when I see something like listItem being used.


Sometimes I can be not clear enough, not your fault

 
~

It's a bit hard to imagine the possible problems without looking at some MTC.

You could have...

  1. forgotten to give the tiddler referenced in $:/state/OTW/editedTiddlera field called "otw-alias"
  2. forgotten to give the second tiddler the tag $:/OTW/Editor
  3. given the second tiddler the tag $:/tags/EditTemplate instead of the first one
  4. etc...

I really appreciate your help Tobias, but the issue is solved. None of the things you are pointing seems like the root cause. I think it was because some CSS rule that was hidding the title divs, and I set that class by mistake to my custom title.

Regards 

Tobias Beer

unread,
Sep 29, 2015, 9:49:14 AM9/29/15
to TiddlyWiki
Hi Danielo,
 
I think it was because some CSS rule that was hidding the title divs, 
and I set that class by mistake to my custom title.

;-)

That's why creating an MTC (Minimal Test-Case) is so important.
Chances are you would already find the problem creating it.

Best wishes,

— tb
Reply all
Reply to author
Forward
0 new messages