Trouble with fields and templates

145 views
Skip to first unread message

RunningUtes

unread,
Oct 12, 2016, 9:45:15 PM10/12/16
to TiddlyWiki
I have some issues with fields that I cant seem to fix.

I have 2 tiddlers:

1) QR
\define QR(text)
<img src="http://chart.apis.google.com/chart?chs=150x150&cht=qr&chl=$text$">
\end
<$macrocall $name="QR" text={{!!title}}/>

2) QR test field
 
<$edit-text class='tc-edit-texteditor'  field='new_QR' placeholder='QR text'/>


{{!!new_QR}}


{{!!new_QR||QR}}

which also has a custom field of new_QR which contains "Hello world"

Basically I can't seem to get the custom field new_QR to work with the template QR

Any tips or did I miss something?

Mark S.

unread,
Oct 12, 2016, 11:29:33 PM10/12/16
to TiddlyWiki
Is there a reason you want to use a template here? What's happening is that the text is seeing the title of the transcluded tiddler.

If you make your test tiddler like this:

<$edit-text class='tc-edit-texteditor'  tiddler="QRData" field='new_QR' placeholder='QR text'/>


<$macrocall $name="QR" text={{QRData!!new_QR}}/>

It seems to work OK this way. Note that I moved the data into a separate tiddler. You might have noticed that it was very hard to type into the edit field. Somewhere in the documentation they warn you not to call the edit widget on a field inside the same tiddler -- some sort of loop-back thing.

Is that an actual QR code that google is giving back? That's certainly a good trick to know!

Good luck!
Mark

RunningUtes

unread,
Oct 13, 2016, 2:50:47 PM10/13/16
to TiddlyWiki
The QR template is something that I really like since I can send almost anything to the template and it will output a QR code that can be quickly scanned by my phone. Easy way to visually transfer information from my computer to the phone at work.

I changed the size from 150x150 to 400x400 so the camera can pick up things a little easier, and I can send roughly 800 characters or so without any problems.

I use the QR template to add useful bits of info into my tiddlers.

Thanks for your help!

Thomas Elmiger

unread,
Oct 14, 2016, 9:31:41 AM10/14/16
to TiddlyWiki
Hi

I experimented a bit with Google’s QR API and found a way to send tiddlers in vcard format to my phone to import in my address book. My macro takes a tiddler title as input and optionally a size:

To transform a tiddler into a QR code use

<<qr-tid "Tiddler Title">>

or

<<qr-tid "Tiddler Title" size:540>>

---

\define qr-tid(tiddler,size:354)
<$wikify name="text" text=<<qr-urlencode """$tiddler$""">>>
<$macrocall $name="qr-code" text=<<text>> size=$size$/>
</$wikify>
\end

\define qr-code(text,size:354)
<img src='http://chart.apis.google.com/chart?chs=$size$x$size$&cht=qr&chl=$text$'>
\end

\define qr-urlencode(tiddler)
<$view format="urlencoded" tiddler="""$tiddler$"""/>
\end

---

If you want to test, you can import a .vcf file like mine directly by dropping it on your wiki.

Greg Davis

unread,
Oct 14, 2016, 2:21:05 PM10/14/16
to TiddlyWiki
Neat! I've been thinking about creating a TW for bookmarks that included QR codes so could transfer links to my phone or tablet. Previously had to use an extension to create png image and embed in TW thus increasing size.

Also like the Firefox extension QR Secret Decoder Ring https://addons.mozilla.org/en-US/firefox/addon/qr-secret-decoder-ring/ , suppose there is something similar for Chrome.

"Right click an image (including a background image), SVG element, or canvas containing a QR code to decode.
Allows internal decoding (using the QR-Logo library) or the choice of the ZXing and MiniQR websites for decoding."

Can be set to go to a link, if a link, or display a textbox with contents.

Jeremy Ruston

unread,
Oct 15, 2016, 1:48:20 PM10/15/16
to tiddl...@googlegroups.com
Hi Greg

On the subject of QR Codes, I found a very good pure JavaScript QR Code generator library:


I’ve completed the initial work of making it into a TW5 plugin (very straightforward as the library is clean and simple), and will publish it shortly. Playing with it prompted me to download a QR Code reader app for my smartphone, and I’ve found that QR Codes are indeed quite powerful.

The plugin lets you encode any text as a QR Code: not just a URL, but even the content of tiddlers can be made into a QR code. So you could transfer a shopping list from your laptop to your phone just by snapping it.

<img src=<<makeqr "http://tiddlywiki.com">>/>

results in the image below.

Best wishes

Jeremy.


--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3ca7f622-988f-407a-96c4-d73455fcb22d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
Oct 15, 2016, 2:58:15 PM10/15/16
to TiddlyWiki
Great stuff,

Does it allow to include logos? like so:
Auto Generated Inline Image 1
Reply all
Reply to author
Forward
0 new messages