\define mailto(email link)
<a href="mailto:$email$">$link$</a>
\end
<$macrocall $name="mailto" email={{!!email}} link="mail me"/>That sort of works, but ...
1) I'd have to include / define that macro in every tiddler where i wanted to use it, right?
Is there an easy way to put all my macros in one tiddler and then just include that into other tiddlers?
2) This seems like an incredibly long way to go around for what amounts to string concatenation
That sort of works, but ...
tiddler: Mike's Mail
email: mi...@do.main
text: {{!!title||mailto}}
tiddler: mailto
text:
\define mailto(email)
<a href="mailto:$email$">click to email</a>
\end
<$macrocall $name="mailto" email={{!!email}}/>
The <$view> widget claims it supports templates, but I couldn't get it to work.
Aaaah, this is maddening. It's so close.
Suppose I create a tiddler with the fields:
x = mike
email = {{!!x}}
then, amazingly,
{{!!email}} displays "mike"
and, weirdly,
<a href={{!!emai}}>link</a> creates a link to "{{!!x}}". hmm.
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}}".
There is some crazy stuff going on between the TW parser and the rendering engine that I'm not following.
--
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 tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.
$ 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)) {This has been discussed several times. You have to use a macro definition. Since I'm on my mobile I can't provide you an example but searching for concatenate in the forum should give you some results.
I am able to concatenate using a macro two strings for example:
\def concatenate(string 1:"", string2:"")
$string1$$string2$
\end
<<concatenate "my" "_car">>
gives me: "my_car"
but when I use a transcluded text:
<<concatenate "my" {{!!text}}>>
I get: "my{{!!text}}" instead of the text field's string which is "_car"
Is there a way to convert a field to a usable string?
<<concatenate "my" {{!!text}}>>
--
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/2_L_vTJ1Zbs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.
Did you try to use $macrocall?
<$macrocall $name="concatenate" string1="my" string2={{!!title}}/>Ok, so the actual code for Blake to use becomes...<$macrocall $name="concatenate" string1="my" string2={{!!title}}/>Correct?
I'd also be interested to know why widgets can use variables and evaluated bits and direct macro calls cannot.
I'd also be interested to know why widgets can use variables and evaluated bits and direct macro calls cannot.
As I did understand Jeremy from other responses, its mainly a performance decision.
-m
--
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/2_L_vTJ1Zbs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.