Antville Project

autoTitle

when i link to a story like this: <% site.link="stoies/59/" %> i get a link that looks like this: stories/59/ however, i'd like to have an "autoTitle" feature that automatically makes a link looking like this: next steps because this is the title of the story. of course, i can always override the default link text with the "text" parameter, but if the title of the story changes, the link becomes wrong. so, an autoTitle feature wouldn't just save me from typing in the title, it would do more. and if i want to turn that feature off because i want to display the actual URL, i want to use this: <% site.link to="stories/59/" autoTitle="off" %>

i' posted a working implementation of this feature there.

comment    

 
hns, October 11, 2002 at 2:27:45 PM CEST

Re: autoTitle

Thanks nex.

I think the feature is a very good and useful one. I don't particularly like the implementation, though (implementation meaning how the feature is designed, not how the code is written). The thing is, we have to do a sizable ammount of coding to check the link target and extract the id in the linkTitle() function, if it is in fact a local story link. (Also, I think it's a mistake to evaluate the link target as local story even if the slash is not the first character in the URL.)

On the other side, the content writer has to write something like "/stories/23423".

I think it would be better for both sides to provide a dedicated macro where we are expecting a link to a story, and allow the content author to just enter the story id. This is both shorter for the writer and easier for us to code.

<% storylink to="23423" %>

What do you think?

(Robert, Tobi: don't we have something like this already?)

link  

 
nex, October 11, 2002 at 2:47:17 PM CEST

Re: Re: autoTitle

you're right, the "storylink" idea is much better. maybe from the user's point of view it would be nice to have one "link" macro that applies autoTitles to everything without a "text" parameter, but weighing in all the otehr arguments, i'm totally for "storylink".

(Also, I think it's a mistake to evaluate the link target as local story even if the slash is not the first character in the URL.) i don't think so -- it works with the site.link macro, which doesn't require a leading slash.

(Robert, Tobi: don't we have something like this already?) i also thought that something like this should exist already, maybe a way to reference a story object from a macro. but i didn't find anything when checking the macro help, so i came up with this idea.

link  

 
hns, October 11, 2002 at 2:51:31 PM CEST

Re: Re: autoTitle

Well, maybe

<% link story="23423" %>

would even be better. We wouldn't have to add another macro and still provide a clear distinction that a macro tag is targeted to a local story.

We could also just keep it as

<% link to="23423" %>

that would reduce the ammount of macro syntax writers have to keep in their head and still be fairly easy for us to parse.

link  

 
robert, October 11, 2002 at 3:16:56 PM CEST

Re: Re: autoTitle

a macro that does what nex described doesn't exist so far, although it would be possible to do something like that using a bunch of undocumented features ;-) which doesn't count.

i'm +1 for a new "storylink"-macro, mainly because of the caching of rendered stories: if we would adapt the link-macro, we would have to exclude stories containing a link-macro from caching (and i assume that a lot of stories have that macro embedded).

another possibility would be to adapt the existing global story_macro() as follows: <% story id="2345" as="link" %>

link  

 
hns, October 11, 2002 at 3:25:09 PM CEST

Off topic: caching

What would it take to allow the macros themselves to mark the stories they're contained in as uncacheable? Macros don't know the story they're contained in, but something like this could work:

where storyparts are rendered:

  res.data.contentIsCachable = true;
  //  render content parts as skin
  ...
  // check if some macro in content does not want to be cached
  if (res.data.contentIsCachable) {
      // do caching
      ...

and in a macro that doesn't want to be cached:

  res.data.contentIsCachable = false;

thoughts? We could also set limited cachability by setting a date.

link  

 
nex, October 11, 2002 at 3:54:27 PM CEST

<% story id="2345" as="link" %>

(suggested by robert above.) this wouldn't be obvious to new users, but looks really cool.

by the way, what about <% story.createtime as="link" %>? ;-)

link  


... 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
status
Youre not logged in ... Login
menu
November 2024
SunMonTueWedThuFriSat
12
3456789
10111213141516
17181920212223
24252627282930
July
recent
zfuture's house here is zfuture's
house
by zfuture (7/31/03, 2:59 AM)
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)
So finally I found
the helma Bugzilla - stupid me.
by mdornseif (7/24/03, 10:28 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)
but blogosphere.us isn't can't really
be rated as spam can it?
by kohlehydrat (7/23/03, 8:08 PM)
More referrer spam www.webfrost.com
by Irene (7/23/03, 7:55 PM)
How to log skin names
I accessed to console?? Hi, I would like to know...
by winson (7/23/03, 4:12 PM)

Click here to get an XML version of this weblog.

Made with Antville
powered by
Helma Object Publisher