Re: [tw] Re: Square brackets, transclusion, and widget problem

2016-01-06 Thread David Allen
I think I figured it out using the set widget.

<$set name=redoneplanet filter="[prefix[{!!planet}]]" value="<$link
to={{!!planet}}>{{!!planet}}" emptyValue={{!!planet}}>
<>


This way, when the planet field does not have square brackets, a link is
created to the tiddler of the same name.  If it does have brackets (and as
a tiddler title doesn't exist), then it is simply transcluded as-is.

On Wed, Jan 6, 2016 at 10:27 AM, David Allen 
wrote:

> Your suggestion is having the same problem as the solution I came up with,
> unless I'm not understanding what you're doing.
>
> Here's what I've got:
>
> <$setvars _aplanet={{!!planet}} theplanet="aplanet[1]">
> >><>
> 
>
>
>
> On Mon, Jan 4, 2016 at 12:27 AM, Tobias Beer  wrote:
>
>> Hi David,
>>
>>
>>> I just need a way to override the link widget's formatting now.
>>> Otherwise Eric Shulman's solution works beautifully.
>>>
>>
>> Unfortunately, that is not true. Although you may feel like you can avoid
>> retrieving the title using a variable, you do need a proper reference and 
>> *[[Some
>> Title]]* is not while *Some Title* is.
>>
>> The one thing I could think is to not use any link widget at all but to
>> transclude the planet field as is, since it already does contain the link
>> notation, e.g. *[[Some Title]]*... so simply inserting that via
>> *{{!!planet}}* should produce a link, e.g.:
>>
>> title: any title
>> planet: [[Some Planet]]
>>
>> {{!!planet}} <= this will be a link!
>>
>> However, using an editor equivalent to the tags editor, any values that
>> do *not* contain spaces will be saved without double square brackets,
>> so...
>>
>> title: any other title
>> planet: Earth
>>
>> {{!!planet}} <= this will NOT be a link!
>>
>> So, as I or Eric suggested, you do need to retrieve the given item from a
>> list-field and store it in a variable ...to be able to properly construct
>> the link using the link widget.
>>
>> Ergo: It is not simply a matter of styles / formatting.
>>
>> Best wishes,
>>
>> Tobias.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "TiddlyWiki" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/tiddlywiki/YpM4Jw8nkdU/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/0f3612fd-9210-4b26-b931-73de3c358caa%40googlegroups.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> David Allen
>



-- 
David Allen

-- 
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/CALaYjLjMmTuVpi7s5BFVTuecO_TZOW13t1BBgjEnExri4qROcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Square brackets, transclusion, and widget problem

2016-01-06 Thread David Allen
Your suggestion is having the same problem as the solution I came up with,
unless I'm not understanding what you're doing.

Here's what I've got:

<$setvars _aplanet={{!!planet}} theplanet="aplanet[1]">
>><>




On Mon, Jan 4, 2016 at 12:27 AM, Tobias Beer  wrote:

> Hi David,
>
>
>> I just need a way to override the link widget's formatting now.
>> Otherwise Eric Shulman's solution works beautifully.
>>
>
> Unfortunately, that is not true. Although you may feel like you can avoid
> retrieving the title using a variable, you do need a proper reference and 
> *[[Some
> Title]]* is not while *Some Title* is.
>
> The one thing I could think is to not use any link widget at all but to
> transclude the planet field as is, since it already does contain the link
> notation, e.g. *[[Some Title]]*... so simply inserting that via
> *{{!!planet}}* should produce a link, e.g.:
>
> title: any title
> planet: [[Some Planet]]
>
> {{!!planet}} <= this will be a link!
>
> However, using an editor equivalent to the tags editor, any values that do
> *not* contain spaces will be saved without double square brackets, so...
>
> title: any other title
> planet: Earth
>
> {{!!planet}} <= this will NOT be a link!
>
> So, as I or Eric suggested, you do need to retrieve the given item from a
> list-field and store it in a variable ...to be able to properly construct
> the link using the link widget.
>
> Ergo: It is not simply a matter of styles / formatting.
>
> Best wishes,
>
> Tobias.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/YpM4Jw8nkdU/unsubscribe.
> To unsubscribe from this group and all its topics, 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/0f3612fd-9210-4b26-b931-73de3c358caa%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
David Allen

-- 
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/CALaYjLjcACFHy4-WGc5Wt38zm6YiyH7btEQUohipSr6F8wAL8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Square brackets, transclusion, and widget problem

2016-01-06 Thread Tobias Beer
Hi David
 

> I think I figured it out using the set widget.
>

Your example doesn't work for me if I put it into a tiddler tagged 
*$:/tags/ViewTemplate* on tiddlywiki.com

This one does:

<$set name=planet
filter="[{!!planet}get[title]]"
emptyValue="{{!!planet}}"
value="<$link to={{!!planet}}>{{!!planet}}">
<>
 

Best wishes,

Tobias. 

-- 
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/562fb706-f04f-4903-8851-b5e5ff58394b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Square brackets, transclusion, and widget problem

2016-01-06 Thread Tobias Beer
Hi again, David,

I think the proper way to do it would be to use a template:

{{||$://templates/planet-link}}

and then:

title: $://templates/planet-link

<$list filter={{!!planet}}/>

Best wishes,

Tobias.

-- 
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/511635e2-5408-461d-ad27-f817fbd02ca5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Square brackets, transclusion, and widget problem

2016-01-03 Thread David Allen
Really, the only thing I need now is a way to override the formatting used
with the <$link> widget, so that the link doesn't appear to be missing.
Since the link widget I'm using is linking to {{!!planet}} and the planet
field is the planet name surrounded by dual square brackets, what its
trying to link to doesn't exist, but I'm using {{!!planet}} as the text for
the link, and the inner text works fine.

I just need a way to override the link widget's formatting now.  Otherwise
Eric Shulman's solution works beautifully.

On Sun, Jan 3, 2016 at 10:47 AM, Tobias Beer  wrote:

> Hi David,
>
> I believe you can use my plugin tobibeer/setvars
>  to properly store a list
> item in a variable ,
> e.g.
>
> <$setvars _planet={{!!planet}} planet="planet[1]">
> <$link to=<>><>
> 
>
> Best wishes,
>
> Tobias.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/YpM4Jw8nkdU/unsubscribe.
> To unsubscribe from this group and all its topics, 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/d8ea46b5-8fc2-4a8c-bf32-a443ae42973d%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
David Allen

-- 
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/CALaYjLhmLehyYX7JnzBjeFpS2M-qJQPixHfhHHH9PVHRtZj6jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Square brackets, transclusion, and widget problem

2016-01-03 Thread Tobias Beer
Hi David,
 

> I just need a way to override the link widget's formatting now.  Otherwise 
> Eric Shulman's solution works beautifully.
>

Unfortunately, that is not true. Although you may feel like you can avoid 
retrieving the title using a variable, you do need a proper reference and 
*[[Some 
Title]]* is not while *Some Title* is.

The one thing I could think is to not use any link widget at all but to 
transclude the planet field as is, since it already does contain the link 
notation, e.g. *[[Some Title]]*... so simply inserting that via 
*{{!!planet}}* should produce a link, e.g.:

title: any title
planet: [[Some Planet]]

{{!!planet}} <= this will be a link!

However, using an editor equivalent to the tags editor, any values that do 
*not* contain spaces will be saved without double square brackets, so...

title: any other title
planet: Earth

{{!!planet}} <= this will NOT be a link!

So, as I or Eric suggested, you do need to retrieve the given item from a 
list-field and store it in a variable ...to be able to properly construct 
the link using the link widget.

Ergo: It is not simply a matter of styles / formatting.

Best wishes,

Tobias.

-- 
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/0f3612fd-9210-4b26-b931-73de3c358caa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Square brackets, transclusion, and widget problem

2016-01-03 Thread Tobias Beer
Hi David,

I believe you can use my plugin tobibeer/setvars 
 to properly store a list 
item in a variable , 
e.g.

<$setvars _planet={{!!planet}} planet="planet[1]">
<$link to=<>><>


Best wishes,

Tobias.


-- 
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/d8ea46b5-8fc2-4a8c-bf32-a443ae42973d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Square brackets, transclusion, and widget problem

2016-01-02 Thread David Allen
That mostly worked.  The only problem now is with the template tiddler I
used to create the new event tiddlers.

Here's the body of the tiddler:

\define empire_lookup()
{{EmpireEventLookupTable##$(thejointype)$}}
\end
<$set name=thejointype value={{!!jointype}}>
{{!!planet}} <> <$link to={{!!faction}}><$view
field=faction>



With planet names that contain spaces, there's no problem.  With ones that
don't, the name doesn't show up as a link

My solution was to replace the {{!!planet}} part with <$link
to={{!!planet}}>{{!!planet}}.  Functionally, this works, but
planets with a space in the name have the link show up as a missing tiddler
link, because it's trying to find a tiddler whose title contains square
brackets.  I can click on the part that {{!!planet}} renders as and bring
up the planet tiddler, but I'd like it so it doesn't look like I have a
bunch of missing tiddlers where I do not.

On Sat, Jan 2, 2016 at 11:08 PM, Eric Shulman  wrote:

> On Saturday, January 2, 2016 at 8:32:51 PM UTC-8, David Allen wrote:
>>
>> The problem is, the value that shows up in the new event tiddler does not
>> contain the square brackets, which makes it not work with the filter
>> above.  What I'd like is some way to construct a string that has square
>> brackets along with the field value and can be passed into a widget and
>> work correctly.
>>
>
>> When I do [[{{!!planet}}]], the result is exactly that string,
>> [[{{!!planet}}]].  When I try to put it into a widget, it comes up as
>> [[$parameter$]].  I'd like to find a way to construct a string literal, but
>> I'm not sure how to do so.
>>
>> Can anyone help me with this?
>>
>
> You can use the <$set> widget with the title filter.  This will add
> brackets to the field value if it contains spaces.  The result can be
> passed into a widget param.  For example:
> <$set name="result" filter="""[title{!!somefield}]""">
> <$text text=<>/>
> 
>
> let me know if this helps
>
> enjoy,
> -e
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/YpM4Jw8nkdU/unsubscribe.
> To unsubscribe from this group and all its topics, 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/2b161ac9-b96d-492c-a651-716d499a7ace%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
David Allen

-- 
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/CALaYjLi6%2BGE8s1FWUhBhNhyh93nd3k72-nG93ma6r0RN4DexSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Square brackets, transclusion, and widget problem

2016-01-02 Thread Eric Shulman
On Saturday, January 2, 2016 at 8:32:51 PM UTC-8, David Allen wrote:
>
> The problem is, the value that shows up in the new event tiddler does not 
> contain the square brackets, which makes it not work with the filter 
> above.  What I'd like is some way to construct a string that has square 
> brackets along with the field value and can be passed into a widget and 
> work correctly.
>

> When I do [[{{!!planet}}]], the result is exactly that string, 
> [[{{!!planet}}]].  When I try to put it into a widget, it comes up as 
> [[$parameter$]].  I'd like to find a way to construct a string literal, but 
> I'm not sure how to do so.
>
> Can anyone help me with this?
>

You can use the <$set> widget with the title filter.  This will add 
brackets to the field value if it contains spaces.  The result can be 
passed into a widget param.  For example:
<$set name="result" filter="""[title{!!somefield}]""">
<$text text=<>/>


let me know if this helps

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/2b161ac9-b96d-492c-a651-716d499a7ace%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.