hns,
July 19, 2002 at 2:54:47 PM CEST
Render content part as image As part of a demo hack I did for a prospective customer planning to convert a website to Antville, I implemented a feature to interpret a content part as an image name and render that image, if it exists. This is useful when displaying images outside of the story text. You could still enter the whole image macro tag, but just taking the image name is much more comfortable for content editors and less error prone. The feature is implemented by passing an as="image" attribute to the content part macro and the following code added to story.content_macro():
Should I check this in? If so, we might consider doing the same for polls, files etc.
robert,
July 19, 2002 at 2:58:18 PM CEST
definetly +1 for that (great idea!). ... comment
tobi,
July 19, 2002 at 3:07:13 PM CEST
+1 for the general idea but could we do this more generic, please? because the next thing is to wrap a content part which contains an url around another content part, e.g. the title (i think this was already requested once by jörg kantel). currently, this is not possible, because i cannot use the link macro and the content part macro at once:
it's also impossible to put the title part as text parameter into the content macro if it had an as="link" parameter:
do you have any suggestions how we could do this, then? (the relation between the image feature and what i have written here might be not so clear: it's about having a custom story extension to be processed further, e.g. as image or as link -- and i think there must be one way to solve both options and probably even more)
hns,
July 19, 2002 at 4:51:32 PM CEST
you do this using <a href="<% this.content part="url" %>"><% this.content part="title" %></a> This is pretty straightforward. The only restriction is that you have to have a URL, which is a good idea anyhow because of UI consistency. But the nested macro syntax we came up with at helma.antville.org is no solution either as long as nested macros can't contain attributes (you need attributes for the content macro to make sense). If this needs to be fixed, I'd rather do it with an extension to the content macro, e.g. <% this.content part="title" linkpart="url" %>
tobi,
July 19, 2002 at 5:02:00 PM CEST
ok. good. first i wondered why i could have missed that simple solution but then i remembered that i stumbled across the fact that this way you implicitely need a url or otherwise you get an empty href (as you indicated). i even tried to think about including the a tag as pre- and suffix but then still the closing tag remains:
... comment
hns,
July 19, 2002 at 4:59:16 PM CEST
it's in the CVS. ... comment
|
The Antville Server Fund has been a great success. Thanks to everybody who contributed!
online for 8550 Days
last updated: 1/4/11, 10:22 AM Youre not logged in ... Login
... home
... topics ... galleries ... Home
... Tags
... Galleries
... about antville ... download ... macros.antville.org ... help.antville.org ... translate antville! ... antville home
i understand your concerns however,
i hardly can think of a solution. certainly, if the...
by tobi (7/29/03, 9:47 AM)
Found several more similar sites
listed This is getting to be quite a concern to...
by cobalt123 (7/27/03, 7:56 PM)
Second Post Alert on Referrer
bug livecatz I put this into "help" and now here:...
by cobalt123 (7/26/03, 7:14 PM)
well it's not easy to
find from here, anyway. think we should include a link,...
by tobi (7/24/03, 11:25 AM)
clock not that it's particularly
earthshattering but the antclock is running slow by about 15...
by kohlehydrat (7/23/03, 8:25 PM)
How to log skin names
I accessed to console?? Hi, I would like to know...
by winson (7/23/03, 4:12 PM)
|