Antville Macros
PLEASE NOTE: The contents of this site are outdated and need to be updated.
Wednesday, 18. January 2017
Grundlegendes: Wie Macros entstehen

Im Zuge der Erneuerung der hier befindlichen Dokumentation soll dargestellt werden, wie die Macros im Quellcode zusammengesetzt werden:

- (Fast) jeder Prototype enthält eine nach ihm benannte JavaScript-Datei (z.B. Story/Story.js)
- Macros sind JavaScript-Funktionen, die auf _macro enden (z.B. abstract_macro())
- Der Macroname ist der Teil vor dem _macro-Suffix (im Beispiel »abstract«)
- Die Argumente für ein Macro bestehen immer aus dem (meist) param genannten Objekt; die Keys müssen allerdings aus der Funktion oder dem Macro-Aufruf erschlossen werden
- Zusätzlich gibt es sog. »positional parameters«, die auf das param-Objekt folgen.


// Definiert globales Macro der Form [Macro not allowed in sandbox: foo]
function foo_macro(param) {
res.write(; // xyz
}</p><p>// Definiert Story-Macro der Form [Macro not allowed in sandbox:]
Story.prototype.foo_macro = function(param, bar) {
res.write(bar) // xzy
};</p><p>// Definiert HopObject-Macro der Form [Macro not allowed in sandbox:]
HopObject.prototype.foo_macro = function(param, arg1, whatever) {
res.write(; // xyz
res.write(param.baz); // 123
res.write(arg1); // frumm
res.write(whatever); // 4711

Globale Macros gelten überall, alle anderen immer nur für den Prototypen, für den sie definiert werden, sowie für die Prototypen, die sich davon ableiten (z.B. kennt Comment die Macros von Story, alle Prototypen kennen die von HopObject).

Es stehen immer alle Macros von Prototypen zur Verfügung, die im path vorkommen. D.h. in einem Stories-Skin gibt es auch die Site-Macros, in einem Story-Skin die von Site und Stories usw.

In einer Story selbst (also im Story-Editor) sind nur Macros erlaubt, die in Story.ALLOWED_MACROS definiert sind.


... Link (0 comments) ... Comment

Tuesday, 13. January 2004
<% layout.image %>


... Link (4 comments) ... Comment

Fonts and colors

Using the layout handler to define colors everywhere in your skins makes changing the appearance of your site according to the four seasons a piece of cake. Use the following macros to refer to the color values as set in your layout preferences:

<% layout.bgcolor %>
<% layout.textcolor %>
<% layout.titlecolor %>
<% layout.linkcolor %>
<% layout.alinkcolor %>
<% layout.vlinkcolor %>
<% layout.smallcolor %>

please note that you do not have to care about whether the color value is a string or a hexadecimal number. antville will add a hash (#) whenever it is necessary.

not enough, there are macros for fonts and font sizes, too. every font definition in the preferences can be expressed by an appropriate macro:

<% layout.textfont %>
<% layout.textsize %>
<% layout.titlefont %>
<% layout.titlesize %>
<% layout.smallfont %>
<% layout.smallsize %>

certainly, you have to include the color and font macros at the right place, ie. inside a valid html tag or a correct cascading style sheet definition.

... Link (0 comments) ... Comment

Saturday, 11. January 2003
<% comment.replylink %>

This macro displays a link to the comments's reply form. To override the default action the "to" parameter can be set, e.g. if you want to provide the reply form directly below the comment:

<% comment.replylink to="#replies" %>

The "text" parameter is available to set a custom link text:

<% comment.replylink text="place your reply" %>

... Link (0 comments) ... Comment

<% comment.comments %>

This macro lists all of the replied comments once added to a comment. There are no options available for this macro. The layout of each comment is determined by the corresponding comment skin.

... Link (0 comments) ... Comment

Online for 7915 days
Last modified: 2/20/20, 5:31 AM
Youre not logged in ... Login
... Home
... Tags

October 2023
Recent updates
Grundlegendes: Wie Macros entstehen Im
Zuge der Erneuerung der hier befindlichen Dokumentation soll dargestellt werden,...
by libralop (1/18/17, 2:21 PM)
If the link on the
starting page leads you to and you want...
by kinomu (1/6/11, 3:43 AM)
how to make topicchooser redundant?
hello, i am new to antville and have a problem...
by cafereiche (1/5/11, 8:26 PM)
+ position and line distance
" itemsuffix="" %> how does ist function? every time when...
by miamicat (7/12/10, 5:23 PM)
with a little javascript like:
<div><% story.content part="lead" fallback="text" %> <script type="text/javascript"><!-- var lead =...
by dotnet (4/9/09, 3:00 PM)
There's another parameter which enables
to specify the blog whose imagelist you would like...
by giardino (1/4/09, 11:00 AM)
Is it possible to create
a link to the root-page of the system or...
by phoque (6/7/08, 12:34 PM)
Thanks a lot for the
quick response, kinomu. The good side: Now I have...
by molosovsky (1/16/08, 11:59 AM)
There is no technical solution
to this problem, but try to change (or insert)...
by kinomu (1/16/08, 10:22 AM)
Sorry if I’m too stupid
to wrap my brain around this problem: Is there...
by molosovsky (1/16/08, 9:48 AM)
Optional viewlink I am using
the lead for long stories. And wish to give the...
by byggvirofbarley (7/12/07, 10:49 PM)
Macros to use smileys in
comments? Hi! I added some smileys to my image gallery...
by stuepfnick (5/20/07, 2:30 PM)
Was suchen Sie denn
by ichichich (5/15/07, 4:06 PM)
Ähm, ich glaube das Fixen
muss nicht mehr sein Hallo, äh 2004 der letzte Inhalt....
by stsboard (3/9/07, 9:48 PM)
I found a solution
and modified it slightly for usage with Antville. Add to...
by ichichich (1/18/07, 1:07 PM)
story.age would be great to
have a macro that does the same for stories. I'd...
by imp13 (1/17/07, 10:40 PM)
is it somehow possible to
change the word "comments" itsself, that automatically results when...
by yetused (11/11/06, 9:55 AM)
Thanks a lot! Just
what I was looking for.
by mwegsche (11/10/06, 11:24 AM)
That is possible:
(Beware: An invalid format of the timestamp may corrupt the database...
by ichichich (11/10/06, 10:38 AM)
Edit date OK, thanks for
the feedback. This was just the answer I had already...
by mwegsche (11/10/06, 8:47 AM)
This is one of
the top requested features...
by ichichich (11/9/06, 5:02 PM)
limit stories I want to
limit the number of stories on the homepage of my...
by mwegsche (11/9/06, 4:58 PM)
To get the login form/skin
you must add to query: skins/edit?key=MemberMgr.login
by click (7/29/06, 1:33 AM)
Need Help! I need to
modify the "Login" form/skin that a visitor to my blog...
by aqss (6/18/06, 10:15 PM)
that more interesting part of
the question didn't get answered ;) how can we...
by schimmerschnecke (1/31/06, 1:02 AM)

RSS feed

Made with Antville
Helma Object Publisher