Would putting the html wrapper in your alias definition work?

<<alias imgdiv "<html><div style="background-image: url(%0); width: %1px; 
height: %2px;>%3</div></html>">>

Cheers, Tobias.

Am Donnerstag, 23. August 2012 04:06:04 UTC+2 schrieb G.J.Robert:
>
> Hi there,
>
> I'm trying to play with the capabilities of AliasPlugin [1]. So far, I 
> have been successful to make aliases as shortcuts to smileys like
>
>> <<alias :) [img[smile]]>> (where the tiddler smile is an uploaded image 
>> via TiddlySpace)
>>
> or as shortcuts to simplify complex syntaxes like
>
>> <<alias pop @@position:relative;+++^30em^[%0]%1===@@>> (prerequisite: 
>> NestedSlidersPlugin; where the "position:relative" is a trick to make the 
>> floatingPanel right under the button on TiddlySpace)
>>
>
> I was trying to extend the usage of alias shortcuts further by defining 
> aliases to render HTML snippets. For example, as with a div with an image 
> as its background, the HTML code would be something like:
>
>> <div style="background-image: url(http://domain.com/image.jpg); width: 
>> XXXpx; height: YYYpx;>abracadabra</div>
>>
> and I hope to use an alias
>
>> <<alias imgdiv "<div style="background-image: url(%0); width: %1px; 
>> height: %2px;>%3</div>">>
>>
> so that I can just type
>
>> <<imgdiv http://url.of.the/image XXX YYY abracadabra>>
>>
> to create the same div as above.
>
> However, in my experiment, when I put this <<imgdiv>> in the 
> <html>...</html> statement block (with HTMLFormattingPlugin installed, for 
> TiddlyWiki syntax to be mixed within the HTML block), the alias just throws 
> out the text of <div style="background-image: url(
> http://domain.com/image.jpg); width: XXXpx; height: 
> YYYpx;>abracadabra</div> (with the URL wikified!), but not making the 
> real div element.
>
> I've also tried to make a simpler alias to insert <p>0%</p>, and again, 
> only the literal <p>Parameter input</p> is rendered.
>
> *Is it ever possible to make aliases substituting working HTML elements 
> instead of displaying the literal codes?*
>
> (I have also tried to make aliases as shortcuts to insert something like 
> "rowspan='%0'" to help simplify the syntax of MediaWikiTableFormatterPlugin 
> [2], also in vain. I guess it's because the aliases cannot be rendered 
> *before* the formatters?)
>
> [1] http://www.tiddlytools.com/#AliasPlugin
> [2] http://devpad.tiddlyspot.com/#MediaWikiTableFormatterPlugin
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/tiddlywiki/-/8i_SgQMYeFwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to