Antville Project

Featureitis again

When writing a function for an Antville object, if i have the number of a story (e.g. story #3 is the one at mysite/stories/3/), how can i get a reference to the story object itself? I'm looking for something like path.site.getStory(storyNum).

comment    

 
hns, October 11, 2002 at 12:19:02 PM CEST

Re: Featureitis again

if mysite is a reference to your site object, try

mysite.stories.get ("3");

Please note that the "3" must be passed as string, otherwise it will be interpreted as index instead of id.

link  

 
nex, October 11, 2002 at 12:59:11 PM CEST

wow, that was quick, thanks

i just verified that i get the correct object when i do this: var story = path.site.stories.get(String(numberOfStory));

now i can do, for example, res.write(story.getContentPart("title")) and it outputs the story's title.

just out of curiosity: story.day and story.topic contain the correct values, but the title and text are null. why's this? anyway, getContentPart works just fine.

link  

 
hns, October 11, 2002 at 1:50:21 PM CEST

title, text, getContentPart

title and text are obsolete (actually, I think title should still contain the title...)

Nowadays, all content ist stored in one "XML blob" which is simply called "content". story.getContentPart() and story.getRenderedContentPart() parse the XML blob and return the specific content part. The idea behind this is that you can define new content parts for stories without any coding, just by adding fields to the story editor skin and displaying the content parts in the story skins where you want them to appear.

link  

 
nex, October 11, 2002 at 2:07:16 PM CEST

Re: title, text, getContentPart

cool!

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