[tw5] Re: Links within fields

2020-06-21 Thread Damon Pritchett
Eric / Tony,

As always, thank you so much. Everything you both said makes perfect 
sense.  I appreciate the input very much. Thanks to both of you, I'm 
learning a great deal about Tiddlywiki.

Damon

On Sunday, June 21, 2020 at 5:48:59 PM UTC-7, Damon Pritchett wrote:
>
> All,
>
> Pretty quick question from someone who knows just enough to do something 
> stupid. I'm starting down the road of having tiddler titles in custom 
> fields with the square brackets around the title so the field turns into a 
> link when displayed. Before I go too far down this path, I'd like to know 
> if this is a path fraught with peril. Is there a reason I shouldn't be 
> doing this and, if so, is there a better way to do it? I've started down 
> that road because I want to use fields instead of tags so that the number 
> of tags doesn't get too large.
>
> Thanks,
>
> Damon
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3d40f072-b3c3-4ca8-91f1-d42e4aff651eo%40googlegroups.com.


[tw5] Re: Links within fields

2020-06-21 Thread TW Tones
Just to note

<$list filter="[tag{!!somefield}}]">...
should be
<$list filter="[tag{!!somefield}]">...

But Erics argument is important. Keeping links as native urls also allows 
you to use the html
Open
Note in the above link the "target" parameter is not in use, but can be 
used to direct the opening of links in a named tab

eg; try this on tiddlywiki.com, click one, return click the other.
https://tiddlywiki.com/#Filter%20Operators; target="tiddlywiki" > 
Filter Operators

https://tiddlywiki.com/#Messages; target="tiddlywiki" > Messages



   - You can always bypass this with open in new window
   - Or control-click to not navigate to the new tab
   

This allows you to reuse the same tab, and also uses pasted permalinks with 
no edit

Regards
Tony


On Monday, June 22, 2020 at 11:04:58 AM UTC+10, Eric Shulman wrote:
>
> On Sunday, June 21, 2020 at 5:48:59 PM UTC-7, Damon Pritchett wrote:
>>
>> Pretty quick question from someone who knows just enough to do something 
>> stupid. I'm starting down the road of having tiddler titles in custom 
>> fields with the square brackets around the title so the field turns into a 
>> link when displayed. Before I go too far down this path, I'd like to know 
>> if this is a path fraught with peril. Is there a reason I shouldn't be 
>> doing this and, if so, is there a better way to do it? I've started down 
>> that road because I want to use fields instead of tags so that the number 
>> of tags doesn't get too large.
>>
>
> If the field value is just a single tiddler title, I'd skip putting in the 
> square brackets, since they might get in the way later on if you want to 
> pass the field value as a parameter to a widget or use it in a filter.
>
> For example:
> <$action-setfield $tiddler={{!!somefield}} text="foobar" />
> or
> <$list filter="[tag{!!somefield}}]">...
>
> In both of these cases, if the square brackets were already part of the 
> field value, then you wouldn't get the results you'd expect.
> The first case would write to a tiddler that has literal square brackets 
> in it's title, and the second case would look for a tag that had
> square brackets in the tag value.
>
> In any case, to make a link from a field value is pretty easy.  All of the 
> following will work:
> <$link to={{!!somefield}}><$text text={{!!somefield}}/>
> or
> <$tiddler tiddler={{!!somefield}}><$link/>
> or even
> {{{ [{!!somefield}] }}}
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/862c0c2e-b0fc-4b31-8005-60e22d468255o%40googlegroups.com.


[tw5] Re: Links within fields

2020-06-21 Thread Eric Shulman
On Sunday, June 21, 2020 at 5:48:59 PM UTC-7, Damon Pritchett wrote:
>
> Pretty quick question from someone who knows just enough to do something 
> stupid. I'm starting down the road of having tiddler titles in custom 
> fields with the square brackets around the title so the field turns into a 
> link when displayed. Before I go too far down this path, I'd like to know 
> if this is a path fraught with peril. Is there a reason I shouldn't be 
> doing this and, if so, is there a better way to do it? I've started down 
> that road because I want to use fields instead of tags so that the number 
> of tags doesn't get too large.
>

If the field value is just a single tiddler title, I'd skip putting in the 
square brackets, since they might get in the way later on if you want to 
pass the field value as a parameter to a widget or use it in a filter.

For example:
<$action-setfield $tiddler={{!!somefield}} text="foobar" />
or
<$list filter="[tag{!!somefield}}]">...

In both of these cases, if the square brackets were already part of the 
field value, then you wouldn't get the results you'd expect.
The first case would write to a tiddler that has literal square brackets in 
it's title, and the second case would look for a tag that had
square brackets in the tag value.

In any case, to make a link from a field value is pretty easy.  All of the 
following will work:
<$link to={{!!somefield}}><$text text={{!!somefield}}/>
or
<$tiddler tiddler={{!!somefield}}><$link/>
or even
{{{ [{!!somefield}] }}}

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e8a36aad-91fd-4cb0-8db0-a8788b892870o%40googlegroups.com.