> And this in the ViewEditTemplate (it doesn't work!):
> <div class {{stretch input{macro='edit tekst 5'>}}}</div>

No disrespect intended in any way, but...

I think perhaps you (and I :-) would benefit greatly if you were to
read through a basic primer on HTML and CSS syntax.  (Sorry, I don't
have any specific recommendations... but I'm sure you can find some
online references that will help... just search around a bit...)

By now -- after asking *so* many detailed technical questions over the
past several months -- I'd expect that you would have built up some
sense of how the various parts of TiddlyWiki are written... e.g., the
differences between CSS syntax (stylesheets), HTML syntax (templates),
wiki syntax (tiddler content), and javascript syntax (plugins, inline
scripts, onclick handlers, etc.).

Unfortunately, it seems that sometimes you are just thrashing about,
randomly mashing together various different bits of syntax in the
hopes that something might work, and then repeating any sucessful
syntax patterns by rote, without having a clear understanding of *why*
those patterns work (which, of course, makes it much more difficult to
apply them to other use-cases).

At the very least, you should always start by looking at how things
have already been written.  For example, even with various TW-specific
enhancements, the TW template definitions must *always* use valid HTML
syntax.  This means using properly nested matching "<" and ">"
delimiters around each element declaration, as well correct use of
either single- or double-quotes surrounding the values used in
attribute declarations.

For example, in response to your current question (how to apply a
custom class in a template)...

If you examine your existing templates (including the built-in shadow
definitions), you will see that nearly every <div> and <span> includes
a class attribute, followed by a TW macro, using this syntax:

<div class="..." macro="..."></div>

The value of the class attribute is a CSS 'selector', composed of one
or more CSS class names (e.g., "stretch", "floatright bold", etc).

The value of the macro attribute is the same as you would enter when
using a macro directly in tiddler content, except that you use quotes
(single or double) instead of the << and >> that usually surround the
macro.

Thus:
   <div class="stretch" macro="edit tekst 5"></div>

When the template is processed and macro="edit tekst 5" is rendered,
it creates an "input" element *within* the containing DIV (which has
class="stretch").  Thus, the CSS rule you declared in your
[[StyleSheet]] (i.e., ".stretch input { width:99%; }") will be applied
and the input field will be rendered at 99% of the width of the
element that contains it.

Of course, there are other (optional) attribute values that you can
define in addition to class="..." and macro="...", and some of these
contain different kinds of syntax *within* their values.  For example:
style="..." uses CSS syntax (e.g., "font-size:36pt;color:red;"), while
an onclick="..." declaration contains javascript programming to handle
'click' events on that element.

Once you have gained some generalized knowledge of basic HTML and CSS
syntax, I think you'll find that you will probably be able to quickly
answer many of your own questions, which should hopefully save a great
deal of time and effort for all concerned.  In fact, if you are
feeling particularly adventurous, you might also want to pick up a
beginner's book on javascript programming, given the extensive use of
custom-written inline scripting in your document(s).

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
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