[TW5] how not to duplicate code?

83 views
Skip to first unread message

sini-Kit

unread,
Apr 6, 2015, 4:28:18 AM4/6/15
to tiddl...@googlegroups.com
Hi! I have 6 tiddlers with practically the same code
div class= "tovar_center">
<$list filter="[is[current]tagging[]tag[$:/Note]sort[title]]">
<span class="textboxwhite"> <tw class='simpleCart_shelfItem'> <$link field="title"> <div class="onclean">  <a><$image  source= {{!!image150x150}} /></a></div>  </$link>  <span class="item_price"> <$addup val1={{!!stoimost}} val2= {{$:/_koefisient_sen}} /> {{$:/temp/_valuta}} </span> <input type="text" class="item_quantity" value="1" size="1"/>  <span class="item_nazvanie"><$link field="title"><$view field="nazvanie"/> ➨</$link></span> <input type="button" class="item_add" value="в корзину" /><br/> <h6 class="item_name"><$view field="title"/></h6></tw>  <$link field="title">  <div class="github-fork-ribbon-wrapper right"> <$list filter="[all[current]tag[hot]]"><div class="github-fork-ribbon" style="background-color: #fbc243;"><a>hot</a></div></$list>   <$list filter="[all[current]tag[sale]]"><div class="github-fork-ribbon" style="background-color: #e23d49;"><a>sale</a></div></$list> <$list filter="[all[current]tag[new]]"><div class="github-fork-ribbon" style="background-color: #6a8801;"><a>new</a></div></$list>      </div> </$link>      </span>
</
$list>
</div>

 they differ only by the second line in sort value. I made tiddler  {{tile}} and put  there <span class="textboxwhite">......</span> but my 6 tiddlers don't work if I use

div class= "tovar_center">
<$list filter="[is[current]tagging[]tag[$:/Note]sort[title]]">
{{tile}}
</$list>
</
div>


i tried $view, $transclude , but it didn't help

links to code.






Xavier Cazin

unread,
Apr 6, 2015, 5:12:29 AM4/6/15
to tiddl...@googlegroups.com
Hi,

What about the template construct {{||tile}} instead?

Xavier.

-- Xavier Cazin

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0d20edb6-6ce0-4c01-9788-47b1288282b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
Apr 8, 2015, 4:16:54 PM4/8/15
to tiddl...@googlegroups.com
Did you tried with title instead of tile?
Reply all
Reply to author
Forward
0 new messages