How to move preview button to below tiddler text

133 views
Skip to first unread message

Alex Hough

unread,
Mar 2, 2016, 4:10:34 AM3/2/16
to TiddlyWiki
I have moved the tags field to below the text by changing the order of the tiddlers tagged with $:/tags/EditTemplate

The


tiddler contains a lot of code, including the "show preview" button.

Therefore I can't use the same technique as I have done with the tags field.

I was thinking that I could remove the button and put it into another tiddler, but I then realised that the preview is contained in the tiddler body and that the button would not work.

It occured to me that the task at hand is not as trivial as it first seemed. 

I don't want to end up down the "tiddly rabbit hole" for the day. Any hints and tips would be most welcome


Alex

BJ

unread,
Mar 2, 2016, 6:00:16 AM3/2/16
to TiddlyWiki, Tiddl...@googlegroups.com

HI Alex,

\define lingo-base() $:/language/EditTemplate/Body/
<$list filter="[is[current]has[_canonical_uri]]">

<div class="tc-message-box">

<<lingo External/Hint>>

<a href={{!!_canonical_uri}}><$text text={{!!_canonical_uri}}/></a>

<$edit-text field="_canonical_uri" class="tc-edit-fields"></$edit-text>

</div>

</$list>

<$list filter="[is[current]!has[_canonical_uri]]">

<$reveal state="$:/state/showeditpreview" type="match" text="yes">

<em class="tc-edit"><<lingo Hint>></em>
<div class="tc-tiddler-preview">
<div class="tc-tiddler-preview-preview">
<$set name="tv-tiddler-preview" value="yes">

<$transclude />

</$set>
</div>

<div class="tc-tiddler-preview-edit">
<$edit field="text" class="tc-edit-texteditor" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>

</div>

</div>
<$button type="set" set="$:/state/showeditpreview" setTo="no"><<lingo Preview/Button/Hide>></$button>

</$reveal>

<$reveal state="$:/state/showeditpreview" type="nomatch" text="yes">

<em class="tc-edit"><<lingo Hint>></em>
<$edit field="text" class="tc-edit-texteditor" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>
<$button type="set" set="$:/state/showeditpreview" setTo="yes"><<lingo Preview/Button/Show>></$button>
</$reveal>

</$list>


all the best
BJ

Alex Hough

unread,
Mar 2, 2016, 8:30:32 AM3/2/16
to TiddlyWiki
Thanks BJ,

which bit did you change?



Alex

--
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/2fbf1fe2-befc-43b7-a0c2-d757bbade499%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BJ

unread,
Mar 2, 2016, 12:55:33 PM3/2/16
to TiddlyWiki
I moved both the <$button> past their <$edit>, actual to the end of their enclosing <$reveal>
Reply all
Reply to author
Forward
0 new messages