Discussion:
[tw] How to retain slashes in tiddler titles when parsed in select?
(too old to reply)
Steven Schneider
2017-08-12 16:35:19 UTC
Permalink
Raw Message
I am using the <select> widget to allow users to make a selection.

The select field is are choosing among tiddlers listed in the list field
of my

<$select tiddler="tiddlerToShow" default='Cover'>
<$list filter='[list<currentTiddler>]'>
<$vars target={{!!target}}>
<option value=<<target>>><$view field='caption'/></option>
</$vars>
</$list>
</$select>


The values of {{!!target}} have slashes in them, like this:

American Government and Politics in the Information
Age//OEBPS/part-001-chapter-1-communication-in-the-information-age.xhtml


and thus [[tiddlerToShow]] gets this value instead:

American Government and Politics in the Information Age
OEBPS/part-001-chapter-1-communication-in-the-information-age.xhtml
<https://stevesunypoly.github.io/amgov-epub-tw/#American%20Government%20and%20Politics%20in%20the%20Information%20Age%2F%2FOEBPS%2Fpart-001-chapter-1-communication-in-the-information-age.xhtml>

Any thought?

//steve.


:
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/4f15d1d0-6ec6-4b89-9fd9-4c1b8881e9ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Eric Shulman
2017-08-12 20:12:12 UTC
Permalink
Raw Message
Post by Steven Schneider
I am using the <select> widget to allow users to make a selection.
The select field is are choosing among tiddlers listed in the list field
of my
<$select tiddler="tiddlerToShow" default='Cover'>
<$list filter='[list<currentTiddler>]'>
<$vars target={{!!target}}>
<option value=<<target>>><$view field='caption'/></option>
</$vars>
</$list>
</$select>
American Government and Politics in the Information
Age//OEBPS/part-001-chapter-1-communication-in-the-information-age.xhtml
American Government and Politics in the Information Age
OEBPS/part-001-chapter-1-communication-in-the-information-age.xhtml
<https://stevesunypoly.github.io/amgov-epub-tw/#American%20Government%20and%20Politics%20in%20the%20Information%20Age%2F%2FOEBPS%2Fpart-001-chapter-1-communication-in-the-information-age.xhtml>
1) There is no need to use <$vars>...</$vars> here... just write:
<option value={{!!target}}>...</option>

2) I recommend using 'fallback' display within the <option>...</option>, so
that if the "caption" field is not defined, the "target" field is shown....
and if "target" is not defined, the "title" field is shown, like this:
<option value={{!!target}}><$view field='caption'><$view
field='target'><$view field='title'/></$view></$view></option>

3) I did a quick test on tiddlywiki.com, and the *contents* of
[[tiddlerToShow]] DO have the double slash characters intact. However,
when you *view* that tiddler's content directly, the "//" is *parsed and
rendered* (correctly) as TW syntax for "start italics"... and, because
there is no matching "//" to "end italics", that formatting continues to
the end of the text that is shown.

4) You can show the *unparsed* content by using (in some other tiddler)
<$text text={{tiddlerToShow}}/>

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/34f27777-2963-4cbd-a67b-1c632ea2eb66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Steven Schneider
2017-08-12 22:34:24 UTC
Permalink
Raw Message
Eric, thanks. Your suggestions are, as usual, right on. So I see that my
select is creating a [[tiddlerToShow]] with the text field set to the name
of a tiddler with "//" in its name.

I get how the <$text text={{tiddlerToShow}}/> works -- so I can see the
content with the //....

But, how do I use my new tiddler [[tiddlerToShow]]? I need to be able to do
<$link to={{tiddlerToShow}}>{{tiddlerToShow}}</$link> and <$transclude
tiddler={{tiddlerToShow}}/>? There must be a magic text cleaning machine
that interprets the slashes for what they are, and not as markup...?

//steve.
Post by Eric Shulman
Post by Steven Schneider
I am using the <select> widget to allow users to make a selection.
The select field is are choosing among tiddlers listed in the list field
of my
<$select tiddler="tiddlerToShow" default='Cover'>
<$list filter='[list<currentTiddler>]'>
<$vars target={{!!target}}>
<option value=<<target>>><$view field='caption'/></option>
</$vars>
</$list>
</$select>
American Government and Politics in the Information
Age//OEBPS/part-001-chapter-1-communication-in-the-information-age.xhtml
American Government and Politics in the Information Age
OEBPS/part-001-chapter-1-communication-in-the-information-age.xhtml
<https://stevesunypoly.github.io/amgov-epub-tw/#American%20Government%20and%20Politics%20in%20the%20Information%20Age%2F%2FOEBPS%2Fpart-001-chapter-1-communication-in-the-information-age.xhtml>
<option value={{!!target}}>...</option>
2) I recommend using 'fallback' display within the <option>...</option>,
so that if the "caption" field is not defined, the "target" field is
shown.... and if "target" is not defined, the "title" field is shown, like
<option value={{!!target}}><$view field='caption'><$view
field='target'><$view field='title'/></$view></$view></option>
3) I did a quick test on tiddlywiki.com, and the *contents* of
[[tiddlerToShow]] DO have the double slash characters intact. However,
when you *view* that tiddler's content directly, the "//" is *parsed and
rendered* (correctly) as TW syntax for "start italics"... and, because
there is no matching "//" to "end italics", that formatting continues to
the end of the text that is shown.
4) You can show the *unparsed* content by using (in some other tiddler)
<$text text={{tiddlerToShow}}/>
enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/8d7b9a9f-33f8-460c-a099-d9c790aafb4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Mark S.' via TiddlyWiki
2017-08-12 23:30:34 UTC
Permalink
Raw Message
I'm trying to understand your data flow. What are the contents of the
target field, and how do they differ from the title? If you put the title
into target, then your scenarios (e.g. <$link
to={{tiddlerToShow}}>{{tiddlerToShow}}</$link> and <$transclude
tiddler={{tiddlerToShow}}/>) work fine (goes to tiddler and pulls contents
respectively). This leads me to think that you have something other than
the title in the target field, in which case your problems have nothing to
do with the double slash.

Good luck,
Mark
Post by Steven Schneider
Eric, thanks. Your suggestions are, as usual, right on. So I see that my
select is creating a [[tiddlerToShow]] with the text field set to the name
of a tiddler with "//" in its name.
I get how the <$text text={{tiddlerToShow}}/> works -- so I can see the
content with the //....
But, how do I use my new tiddler [[tiddlerToShow]]? I need to be able to
do <$link to={{tiddlerToShow}}>{{tiddlerToShow}}</$link> and <$transclude
tiddler={{tiddlerToShow}}/>? There must be a magic text cleaning machine
that interprets the slashes for what they are, and not as markup...?
//steve.
Post by Eric Shulman
Post by Steven Schneider
I am using the <select> widget to allow users to make a selection.
The select field is are choosing among tiddlers listed in the list
field of my
<$select tiddler="tiddlerToShow" default='Cover'>
<$list filter='[list<currentTiddler>]'>
<$vars target={{!!target}}>
<option value=<<target>>><$view field='caption'/></option>
</$vars>
</$list>
</$select>
American Government and Politics in the Information
Age//OEBPS/part-001-chapter-1-communication-in-the-information-age.xhtml
American Government and Politics in the Information Age
OEBPS/part-001-chapter-1-communication-in-the-information-age.xhtml
<https://stevesunypoly.github.io/amgov-epub-tw/#American%20Government%20and%20Politics%20in%20the%20Information%20Age%2F%2FOEBPS%2Fpart-001-chapter-1-communication-in-the-information-age.xhtml>
<option value={{!!target}}>...</option>
2) I recommend using 'fallback' display within the <option>...</option>,
so that if the "caption" field is not defined, the "target" field is
shown.... and if "target" is not defined, the "title" field is shown, like
<option value={{!!target}}><$view field='caption'><$view
field='target'><$view field='title'/></$view></$view></option>
3) I did a quick test on tiddlywiki.com, and the *contents* of
[[tiddlerToShow]] DO have the double slash characters intact. However,
when you *view* that tiddler's content directly, the "//" is *parsed and
rendered* (correctly) as TW syntax for "start italics"... and, because
there is no matching "//" to "end italics", that formatting continues to
the end of the text that is shown.
4) You can show the *unparsed* content by using (in some other tiddler)
<$text text={{tiddlerToShow}}/>
enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/9c6d0caa-5cb2-44e3-9a9a-8a8d0a096e32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Mark S.' via TiddlyWiki
2017-08-12 23:41:03 UTC
Permalink
Raw Message
Correction, if you link like this:

<$link to={{tiddlerToShow}}><$view tiddler=tiddlerToShow
field=text/></$link>

it will both link and view correctly. However, even if you did it as <$link
to={{tiddlerToShow}}>{{tiddlerToShow}}</$link> it would link correctly --
it would look slightly different, but given how long the title is I don't
know if that's the biggest issue.

Mark
Post by 'Mark S.' via TiddlyWiki
I'm trying to understand your data flow. What are the contents of the
target field, and how do they differ from the title? If you put the title
into target, then your scenarios (e.g. <$link
to={{tiddlerToShow}}>{{tiddlerToShow}}</$link> and <$transclude
tiddler={{tiddlerToShow}}/>) work fine (goes to tiddler and pulls contents
respectively). This leads me to think that you have something other than
the title in the target field, in which case your problems have nothing to
do with the double slash.
Good luck,
Mark
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/8da1181d-33d6-4a38-a6b6-ebf42fce1ef9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Eric Shulman
2017-08-13 05:25:03 UTC
Permalink
Raw Message
Post by Steven Schneider
I get how the <$text text={{tiddlerToShow}}/> works -- so I can see the
content with the //....
But, how do I use my new tiddler [[tiddlerToShow]]? I need to be able to
do <$link to={{tiddlerToShow}}>{{tiddlerToShow}}</$link> and <$transclude
tiddler={{tiddlerToShow}}/>? There must be a magic text cleaning machine
that interprets the slashes for what they are, and not as markup...?
<$link to={{tiddlerToShow}}><$text text={{tiddlerToShow}}/></$link>

The "to" param of the <$link> widget is not *rendered*... thus, the "//"
contained in the value is used as-is, and the <$text> widget within the
link displays the tiddler title, with the "//" intact, as previously noted.

Likewise, with <$transclude tiddler={{tiddlerToShow}}/>, the "tiddler"
param is not *rendered*... and the "//" is used as-is.

-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+***@googlegroups.com.
To post to this group, send email to ***@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/3bed6bd3-5b5e-4a00-ab95-753ba836f617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Steven Schneider
2017-08-13 19:57:56 UTC
Permalink
Raw Message
Thanks, Eric & Mark. Got it to work as you suggested it would.. Much
appreciated. //steve.
Post by Eric Shulman
Post by Steven Schneider
I get how the <$text text={{tiddlerToShow}}/> works -- so I can see the
content with the //....
But, how do I use my new tiddler [[tiddlerToShow]]? I need to be able to
do <$link to={{tiddlerToShow}}>{{tiddlerToShow}}</$link> and <$transclude
tiddler={{tiddlerToShow}}/>? There must be a magic text cleaning machine
that interprets the slashes for what they are, and not as markup...?
<$link to={{tiddlerToShow}}><$text text={{tiddlerToShow}}/></$link>
The "to" param of the <$link> widget is not *rendered*... thus, the "//"
contained in the value is used as-is, and the <$text> widget within the
link displays the tiddler title, with the "//" intact, as previously noted.
Likewise, with <$transclude tiddler={{tiddlerToShow}}/>, the "tiddler"
param is not *rendered*... and the "//" is used as-is.
-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+***@googlegroups.com.
To post to this group, send email to ***@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/108bc7a9-d0eb-45a9-92c7-6ae5365182bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...