[tw5] Re: Scope of {{!!field}}

2019-06-07 Thread Brian Diamante
This is great. Didn't know about <>... so many possibilities!

I appreciate the help!

Brian

On Thursday, June 6, 2019 at 12:19:21 PM UTC-6, Eric Shulman wrote:
>
> On Thursday, June 6, 2019 at 10:38:47 AM UTC-7, BJ wrote:
>>
>> the tabs macro uses the variable 'currentTab' so you could test for 
>> currentTiddler being empty and if so use the currentTab:
>> <$set name="currentTiddler" filter="[all[current]]" value=<
>> > emptyValue=<>>
>> <$text text={{!!month}}/>
>> 
>>
>>
> There's another, much simpler way to do this, using the <$tiddler> 
> widget.  Just add the following in any tiddler that you want to show in a 
> tabset:
>
> <$tiddler tiddler=<>>
> ...
> tiddler content goes here, e.g., <$text text={{!!month}}/>
> ...
> 
>
> When the tiddler is displayed directly, the <> variable is 
> undefined, and the <> is unchanged (i.e., the $tiddler 
> widget has no effect).  However, when the tiddler is displayed **within a 
> tabset**, the <> variable *is* defined, and the <$tiddler> 
> widget changes the <> value to match the title of the 
> tiddler being displayed in the tab, allowing 'local' field references 
> (i.e., {{!!!month}}) to work as desired.
>
> enjoy,
> -e
>
>
>
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/19814a6b-d419-456e-ad72-bc8b678c3b46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Scope of {{!!field}}

2019-06-06 Thread Eric Shulman
On Thursday, June 6, 2019 at 10:38:47 AM UTC-7, BJ wrote:
>
> the tabs macro uses the variable 'currentTab' so you could test for 
> currentTiddler being empty and if so use the currentTab:
> <$set name="currentTiddler" filter="[all[current]]" value=<
> > emptyValue=<>>
> <$text text={{!!month}}/>
> 
>
>
There's another, much simpler way to do this, using the <$tiddler> widget.  
Just add the following in any tiddler that you want to show in a tabset:

<$tiddler tiddler=<>>
...
tiddler content goes here, e.g., <$text text={{!!month}}/>
...


When the tiddler is displayed directly, the <> variable is 
undefined, and the <> is unchanged (i.e., the $tiddler 
widget has no effect).  However, when the tiddler is displayed **within a 
tabset**, the <> variable *is* defined, and the <$tiddler> 
widget changes the <> value to match the title of the 
tiddler being displayed in the tab, allowing 'local' field references 
(i.e., {{!!!month}}) to work as desired.

enjoy,
-e




-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/550d705e-2af9-44e6-8464-545acfb98f7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Scope of {{!!field}}

2019-06-06 Thread BJ
the tabs macro uses the variable 'currentTab' so you could test for 
currentTiddler being empty and if so use the currentTab:


<$set name="currentTiddler" filter="[all[current]]" value=<> 
emptyValue=<>>
<$text text={{!!month}}/>




On Thursday, June 6, 2019 at 5:36:32 PM UTC+2, Brian Diamante wrote:
>
> Hi Tony,
>
> As usual, I left out a couple of important details. I'm using the tiddler 
> referencing {{!!month}} as a template so pulling the field from the current 
> tiddler is my intention. I'm trying to get around having to explicitly 
> include the tiddler title in the fieldname reference (don't want to use 
> {{October!!month}}).
>
> Adding a little more detail, my tiddler looks like this:
> <$macrocall $name="my-calendar" 
> year={{$:/tdg/vars/calendar-schoolyear-startyear!!year}} month=10/>
>
> !! Reports Due This Month
> 
> 
> <$macrocall $name="custom-links" monthtag=October sorttype=<
> > sortby=day/>
> 
> 
>
>
> I want to use this template in 12 tiddlers, one for each month, which will 
> then be viewed in a separate tiddler via the tabs macro. I'm trying to get 
> around having to manually change the month number (10 in the example above) 
> and month tag (October in the example above) in each of the 12 month 
> tiddlers. Generally speaking, I would have other uses for this type of 
> abstraction as well, but can't get it to work.
>
> If I use a field reference ({{!!month}}, for example) insead of the 
> explicit month number/tag, it works fine in the tiddler, but breaks in the 
> tabs tiddler.
>
> I've tried various set widget combos and macros but can't get it to work.
>
> Thanks,
> Brian
>
> On Thursday, June 6, 2019 at 2:57:07 AM UTC-6, TonyM wrote:
>>
>> Brian
>>
>> In the text reference !!fieldname you are not specifying the tiddler name 
>> as in tiddlername!!fieldname. Thus it applies to current tiddler not the 
>> tiddler it is coded in. 
>>
>> You can change the way you reference the fieldname in another tiddler by 
>> including the tiddler name or set the current tiddler. The current tiddler 
>> is set by default inside lists or you can use the tiddler widget
>>
>> <$tiddler tiddler=tiddlername>
>> in here current tiddler is tiddler name
>> So {{!!title}} is the same as 
>> {{tiddlername!!title}} and <>
>> 
>>
>> I hope this helps because I can see you need to make this conceptual leap.
>>
>> Regards
>> Tony
>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/362b2aea-7ed6-4485-85bd-fc597d551f4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Scope of {{!!field}}

2019-06-06 Thread Brian Diamante
Hi Tony,

As usual, I left out a couple of important details. I'm using the tiddler 
referencing {{!!month}} as a template so pulling the field from the current 
tiddler is my intention. I'm trying to get around having to explicitly 
include the tiddler title in the fieldname reference (don't want to use 
{{October!!month}}).

Adding a little more detail, my tiddler looks like this:
<$macrocall $name="my-calendar" 
year={{$:/tdg/vars/calendar-schoolyear-startyear!!year}} month=10/>

!! Reports Due This Month


<$macrocall $name="custom-links" monthtag=October sorttype=<> 
sortby=day/>




I want to use this template in 12 tiddlers, one for each month, which will 
then be viewed in a separate tiddler via the tabs macro. I'm trying to get 
around the having to manually change the month number (10 in the example 
above) and month tag (October in the example above) in each of the 12 month 
tiddlers. Generally speaking, I would have other uses for this type of 
abstraction as well, but can't get it to work.

If I use a field reference ({{!!month}}, for example) insead of the 
explicit month number/tag, it works fine in the tiddler, but breaks in the 
tabs tiddler.

I've tried various set widget combos and macros but can't get it to work.

Thanks,
Brian

On Thursday, June 6, 2019 at 2:57:07 AM UTC-6, TonyM wrote:
>
> Brian
>
> In the text reference !!fieldname you are not specifying the tiddler name 
> as in tiddlername!!fieldname. Thus it applies to current tiddler not the 
> tiddler it is coded in. 
>
> You can change the way you reference the fieldname in another tiddler by 
> including the tiddler name or set the current tiddler. The current tiddler 
> is set by default inside lists or you can use the tiddler widget
>
> <$tiddler tiddler=tiddlername>
> in here current tiddler is tiddler name
> So {{!!title}} is the same as 
> {{tiddlername!!title}} and <>
> 
>
> I hope this helps because I can see you need to make this conceptual leap.
>
> Regards
> Tony
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/6046afa2-075f-429f-bd90-b26fc5c1ca6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Scope of {{!!field}}

2019-06-06 Thread TonyM
Brian

In the text reference !!fieldname you are not specifying the tiddler name as in 
tiddlername!!fieldname. Thus it applies to current tiddler not the tiddler it 
is coded in. 

You can change the way you reference the fieldname in another tiddler by 
including the tiddler name or set the current tiddler. The current tiddler is 
set by default inside lists or you can use the tiddler widget

<$tiddler tiddler=tiddlername>
in here current tiddler is tiddler name
So {{!!title}} is the same as 
{{tiddlername!!title}} and <>


I hope this helps because I can see you need to make this conceptual leap.

Regards
Tony

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/dae1c79f-505f-4cdd-a02b-ead5c68c41cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Scope of {{!!field}}

2019-06-06 Thread PMario
Hi, 
Have a closer look at: https://tiddlywiki.com/#tabs%20Macro ... Near the 
end, where it talks about the template 
-m

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/959fbc1e-a070-4099-a0fa-c4cf57b75d07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.