How to? Button in editor for automatic inserting picture with special attributes

179 views
Skip to first unread message

Surya

unread,
Dec 27, 2017, 6:02:13 PM12/27/17
to TiddlyWiki
Hi,

I have designed some buttons in the editor for automatic formatting or inserting something. And gave them a simple design just with letters or symbols like
→½∅
by writing inside the command-tiddler after the command:
@@→½∅ √@@

But I tried and tried without success to do it with inserting an image with this:

<img width=120 src="URL-adress of the picture" style=" float:left;padding: 0 1em 0 0;"/>
Your text goes here
<div style="clear:both;line-height:0px;"></div>

How do have to write the command? I'd like to have a button in the editor just like
+IMG

Thanks in advance!
Bettina

Surya

unread,
Jan 3, 2018, 6:34:48 PM1/3/18
to TiddlyWiki
Hi,

does really nobody know a command for putting the text


<img width=120 src="URL-adress of the picture" style=" float:left;padding: 0 1em 0 0;"/>
Your text goes here
<div style="clear:both;line-height:0px;"></div>

in a tiddler?

Regards, Bettina

Mark S.

unread,
Jan 3, 2018, 6:56:19 PM1/3/18
to TiddlyWiki
You probably already know about the stamp tool on the editor bar that can insert pieces of text. That would be the quick way to add the ability to the editor.

-- Mark

Surya

unread,
Jan 3, 2018, 7:22:59 PM1/3/18
to TiddlyWiki
No, I didn't know it before- I wondered for what it could be and thought I don't need it, because of the possibility of the quick way of copy & paste.

Fine :-) Thanks!

If I don't need the other text snippets there, can I delete them without disadvantage? (I would copy the text of them into one "Help"-tiddler, so that I can always create them again, if I need them one time).

Mark S.

unread,
Jan 3, 2018, 9:44:04 PM1/3/18
to TiddlyWiki
The built-in ones are part of core plugins. Use the advanced search under shadows to look for $:/tags/TextEditor/Snippet . Open each tiddler you don't want to show and delete it's tag ($:/tags/TextEditor/Snippet). If you ever want them back, you can look for $:/language/Snippets under the system tab. Find the one's you want to restore and (ironically) delete them. When you delete them, the shadow versions come back into play.

-- Mark

@TiddlyTweeter

unread,
Jan 4, 2018, 4:35:57 AM1/4/18
to TiddlyWiki
Mark S.

Many of your tips deserve to go on a dedicated TIPS PAGE / TW.

Just saying
Josiah

Surya

unread,
Jan 4, 2018, 3:49:40 PM1/4/18
to TiddlyWiki
Hi,

why I wanted to delete them was not only because I don't want to see them anymore. But also I want to hold the wikis as small as possible (in size and in storage used). For that I'd like to delete everything I don't need.

But I think, just deleting the tag $:/tags/TextEditor/Snippet, it wouldn't make the wiki smaller, isn't it?

Mark S.

unread,
Jan 4, 2018, 5:47:16 PM1/4/18
to TiddlyWiki
Those snippets are embedded in the core. You could delete the core, which would save a lot of space. But of course, TiddlyWiki wouldn't run any more.

Together, those snippets take about 1k of space. Which is only 0.04% of the total TiddlyWiki file size.

-- Mark

TonyM

unread,
Jan 4, 2018, 10:34:54 PM1/4/18
to TiddlyWiki
Bettina,

Have you considered defining a macro in a Tiddler tagged $:/tags/Macro that accepts the image url and displays the image? You could then create a snipit that calls the macro. Easier to read and you reuse the same code.

Eg in wiki text
<<imagebyurl "http://imageaddress">>

Macro definition

\define imagebyurl(url)
... Your macro with $url$ in correct place
\end

Regards
Tony

Surya

unread,
Jan 5, 2018, 7:20:01 PM1/5/18
to TiddlyWiki
Hi,

@Mark: No of, course, then I won't delete any of them. Probably I'll just make them invisible for me.

@Tony: Ähhhm, I didn't understand anything of what you wrote- I'm very sorry... I don't know anything about makros....

Birthe C

unread,
Jan 5, 2018, 8:31:13 PM1/5/18
to TiddlyWiki

TonyM

unread,
Jan 5, 2018, 9:36:41 PM1/5/18
to TiddlyWiki
Bettina,

I am away in the bush but once I return to the big smoke I will make a simple macro for you if no one has already done so, with an explanation. Do share what you finally decide to use and I will match that.

Macros can be used in very simple ways to simplify what you put in your Tiddlers or they may be very sophisticated. For you I will give a simple example you can use to do what you require above, and possibly use what you learn. Be confident.

Regards
Tony

Surya

unread,
Jan 7, 2018, 2:46:48 PM1/7/18
to TiddlyWiki
Thanks Tony :-)
Reply all
Reply to author
Forward
0 new messages