Subject: [tw] Re: How to retain slashes in tiddler titles
when parsed in select?



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


On Saturday, August 12, 2017 at 3:34:24 PM UTC-7, Steven Schneider wrote: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.



On Saturday, August 12, 2017 at 4:12:12 PM UTC-4, Eric Shulman wrote:On Saturday, August 12, 2017 at 9:35:19 AM UTC-7, Steven Schneider wrote: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 AgeOEBPS/part-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,-eEric ShulmanTiddlyTools.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 [email protected].
To post to this group, send email to [email protected].
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.



Programming list archiving by: Enterprise Git Hosting