Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> childlink export question
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1316984811

Message started by Steve Ersinghaus on Sep 25th, 2011, 5:06pm

Title: childlink export question
Post by Steve Ersinghaus on Sep 25th, 2011, 5:06pm

Gentlepeople,

Is there a way to adjust the ^childlink()^ export code so that upon export the lists don't use the hierarchical ul li html code.  I'd like to play with some random sorts of the lists using javascript.  Or is there an alternative, such as sorting the lis themselves, so I guess this is a javascript question also/maybe?

Title: Re: childlink export question
Post by Mark Bernstein on Sep 25th, 2011, 5:23pm

^childlink always exports an unordered list of links.

But you say you'd like to use javascript to manipulate the links. That's easy enough, especially using jquery or prototype.js. Just walk the DOM to locate the <ul> that contains your child links, and replace it with whatever you like.  

Title: Re: childlink export question
Post by Mark Anderson on Sep 25th, 2011, 5:44pm

Yes, just use the whole syntax (4 arguments) but for instance leave them all empty - e.g. ^childLinks("","","","")^.

You can't sort ^childLinks^. Instead you'd need to use action code to build a list of linked items, sort that and then export.

Title: Re: childlink export question
Post by Steve Ersinghaus on Sep 26th, 2011, 9:30am

The plan is to place the childlinks into a space beneath note content and provide a random or even slightly animated set of links to other "stories" or "poems" in the web compendium.  It's actually the same set up as this, just with different DOM manipulation: http://steveersinghaus.com/auniverse/poems/seconds.html  

It should be a nice iPad experiment.

Title: Re: childlink export question
Post by Mark Anderson on Sep 26th, 2011, 10:40am


Quote:
The plan is to place the childlinks into a space beneath note content and provide a random or even slightly animated set of links to other "stories" or "poems" in the web compendium.

Are the latter children of the current note? Otherwise, I'm not sure it's ^childLinks^ that you need to make the links you describe.

If you do use a ul/li output structure for the links, give the list tag (<ul>) an id attribute to make it easier to find and manipulate in the JavaScript you're using.

Title: Re: childlink export question
Post by Steve Ersinghaus on Sep 27th, 2011, 11:43am

The structure goes root document and a container called fictions inside which exist the notes that contain stories.  Everything works at the moment.  I haven't played with latest TBX export codes, though.  I imagine I could grab children or siblings.

Title: Re: childlink export question
Post by Mark Anderson on Sep 27th, 2011, 11:55am

TB offers a number of link set generation export codes as listed here. ^siblings^ might be one you want to look at.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.