I was thinking more about it and tried something but I couldn't get it to 
work. I tried to update the <$fields> widget to have an extra parameter 
$fieldList and change "exclude" to be a boolean. That way you can specify a 
list of fields and whether you want ONLY those or all BUT those. This makes 
it super easy to take advantage of the existing $var$ replacement that the 
field widget does and pass a url or string in as a template. Something like 
this:

$ diff fields_orig.js fields.js 
45,46c45,46
< 
<     this.exclude = this.getAttribute("exclude");
---
>     this.fieldList = this.getAttribute("fieldList");
>     this.exclude = this.getAttribute("exclude","no") === "yes";
51,53c51,53
<     var exclude;
<     if(this.exclude) {
<         exclude = this.exclude.split(" ");
---
>     var fieldList;
>     if(this.fieldList) {
>         fieldList = this.fieldList.split(" ");
55c55
<         exclude = ["text"]; 
---
>         fieldList = ["text"]; 
62c62,63
<             if(exclude.indexOf(fieldName) === -1) {
---
>             if((this.exclude && fieldList.indexOf(fieldName) === -1) ||
>              (!!this.exclude && fieldList.indexOf(fieldName) !== -1))    {
69c70,71
<             if(exclude.indexOf(fieldName) === -1) {
---
>             if((this.exclude && fieldList.indexOf(fieldName) === -1) ||
>              (!!this.exclude && fieldList.indexOf(fieldName) !== -1))    {



On Monday, February 3, 2014 3:41:02 PM UTC-5, Jeremy Ruston wrote:
>
> Hi Mike
>
> Going back to your original question, consider the example you gave:
>
> <a href="mailto:<$view field="email">">click to email</a>
>
> At the moment, that doesn't work because the double quotes on the href 
> attribute cause the value to be interpreted as a literal string. The docs 
> point out that we also support quoting attribute values with double curly 
> braces (for transclusion) and double angle brackets (for macro invocations).
>
> We could also support a quote symbol that caused the attribute value to be 
> parsed as wikitext and rendered. For example, using quadruple round 
> brackets for illustration:
>
> <a href=((((mailto:<$view field="email">))))>click to email</a>
>
> The reason originally that I didn't support something like that format is 
> because it felt like it led to overly complex symbol soup (which is a 
> frequent danger for TW5). I felt that the macro syntax offered a way to 
> simplify things by allowing the gobbledegook needed for the attribute value 
> to be packed up into a neat named macro definition.
>
> Anyhow, supporting element attributes in wikitext remains an option.
>
> Also, it's worth mentioning that TW5 will support global macros soon.
>
>  Aaaah, this is maddening. It's so close.
>
>
> I'll try to work through the examples, but appreciate your feedback.
>  
>
>> Suppose I create a tiddler with the fields:
>> x = mike
>> email = {{!!x}}
>> then, amazingly, 
>> {{!!email}} displays "mike"
>>
>
> Transclusion wikifies the transcluded tiddler field value.
>  
>
>> and, weirdly,
>> <a href={{!!emai}}>link</a> creates a link to "{{!!x}}". hmm.
>>
>
> Transcluding an element attribute value currently does not wikify the 
> transcluded tiddler field value.
>  
>
>> even weirder, changing the email field to be
>> email = mailto:{{!!x}}
>> then 
>> {{!!email}} displays "mailto:{{!!x}}";
>> and, weirdly,
>> <a href={{!!email}}>link</a> creates a link to "mailto:{{!!x}}";.
>>
>
> Subtly, what's going on here is that TW5 is wikifying the text 
> "mailto:{{!!x}}";, and it sees the "mailto:"; part as the start of a mailto 
> URI. It treats the text up to the closing curly braces as part of the 
> literal mailto URI, and so never sees the transclusion.
>  
>
>> There is some crazy stuff going on between the TW parser and the 
>> rendering engine that I'm not following.
>
>       
> Hopefully that clarifies the present situation a little.
>
> I think we need to add ways to explicitly specify whether the target text 
> of a transclusion or macro invocation is to be wikified or not. There are 
> situations where both are required.
>
> Best wishes
>
> Jeremy
>
>
>
>
> On Mon, Feb 3, 2014 at 8:17 PM, Julie <[email protected] <javascript:>
> > wrote:
>
>> Le lundi 3 février 2014 15:26:15 UTC+1, Mike a écrit :
>>
>>> The <$view> widget claims it supports templates, but I couldn't get it 
>>> to work.
>>>
>>
>>  Not really... the ViewWidget claims that it supports templates *with 
>> certain formats*, and in the formats list only the date format seems to 
>> work with a template.
>>  
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/tiddlywiki.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Jeremy Ruston
> mailto:[email protected] <javascript:>
>  

-- 
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 http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to