Welcome, Guest. Please Login or Register
Tinderbox
  News:
Looking for tech support? Contact info@eastgate.com
  HomeHelpSearchLoginRegister  
 
Pages: 1
Send Topic Print
Having child notes inherit parent attribute values (Read 10391 times)
Marisa Antonaya
Full Member
*
Offline



Posts: 22
Montreal, Canada
Having child notes inherit parent attribute values
Oct 08th, 2008, 9:29am
 
Hello everyone,

I'm setting up a teaching and research file, and have a question about making it easier for some notes to inherit attribute values.

I've create a prototype called protoBiblio, which will be used for research notes. For this, I've created a set of attributes such as Author, Title, etc. What I'd like is to tell this prototype that notes using this prototype should pass on the attribute values (the title of the article or book, the author's name...) to children. This is because I break up my research of each article into several notes: a parent note with the name of the book or article, and child notes on with snippets of quotes or ideas that will be used separately in my teaching/writing. I'd basically like to avoid having to fill out the attribute fields over and over again for notes that refer to the same work. So this way, when I make one of these child notes, all the fields would fill in automatically.

Is this possible? And if so, how would it affect (if at all) alias notes placed under different parents or agents?

Thanks for your help!
Marisa
Back to top
 
 
  IP Logged
Sebastian Stephenson
Full Member
*
Offline



Posts: 100

Re: Having child notes inherit parent attribute values
Reply #1 - Oct 8th, 2008, 9:37am
 
hi

just to say that I am a tinderbox newbie but I think you want to look at the stamps feature(under the 'values' menu bar item ) they are details in the tinderbox user manual that comes with it and you should find out more there its on page 108

I have not used this personally but I think this maybe what you are looking for

hope this helps
Back to top
 
 
Sebastian Stephenson sebey9   IP Logged
Marisa Antonaya
Full Member
*
Offline



Posts: 22
Montreal, Canada
Re: Having child notes inherit parent attribute values
Reply #2 - Oct 8th, 2008, 9:58am
 
Hi Sebastian,

Thanks for such a quick reply!

I normally use stamps to quickly assign prototypes to new notes. It would be very time-consuming, I think, to create a separate stamp for every title, author, publication, etc. I have in the file (and will have in the future). I think what I'm looking for now is some sort of OnAdd action that would be executed whenever I add a child note. I've looked for an example of this in the manual, but no luck. Since most of my prior use of TB has been with website export and management, I'm woefully ignorant of many things concerning actions... Embarrassed  Grin


Marisa
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2353
Eastgate Systems, Inc.
Re: Having child notes inherit parent attribute values
Reply #3 - Oct 8th, 2008, 11:41am
 
The container's OnAdd action can set the child's attributes.  For example, suppose all the books inside GIBBON should have their Keywords contain "Gibbon".

     OnAdd: Keywords = $Keywords+"Gibbon"

Or, the children might use a Rule to grab settings from their container:

     Rule: Topic |= $Topic(parent)

This means, "If I have no topic, set my topic to whatever topic my parent has.  If I do have a topic already, though, leave it alone."
Back to top
 
 

Mark Bernstein
WWW eastgateSystems@mac.com   IP Logged
Johnnie Wilcox - mistersquid
Full Member
*
Offline



Posts: 83
San Francisco, CA
Re: Having child notes inherit parent attribute values
Reply #4 - Oct 8th, 2008, 12:41pm
 
Mark's answer is the most direct solution for your issue, Marisa.

Another approach is to create a prototype that inherits the attributes from its parent if that attribute is empty. The way to do this is to give the prototype a Rule of the form

Code:
if (!Author) {Author=$Author(parent)} 



This Rule tells the prototype (and notes with it as a prototype) that if the Author attribute is blank to inherit the Author of its parent. You can customize the rule to alter a series of attributes based on one attribute or to assign each attribute independently. This approach avoids clobbering any data that might be present should you decide to move the note, change the Author manually, and move the note back in. The code can also be used in the "OnAdd" field in Mark's suggested approach.

A 3rd approach is to create an agent that gathers the notes you are interested in and to use the code to assign attributes in the "Action" field of the agent.

hth
Back to top
 
 
  IP Logged
Marisa Antonaya
Full Member
*
Offline



Posts: 22
Montreal, Canada
Re: Having child notes inherit parent attribute values
Reply #5 - Oct 8th, 2008, 1:35pm
 
Thanks, everyone. I feel I have a better grasp of what I need to do now, so I'll start experimenting.

The child notes wouldn't be moved away from their parents, but I would create aliases to help link them to my lecture topics; so I'll see how setting up such actions affects the aliases.
Back to top
 
 
  IP Logged
Willem Smelik
Full Member
*
Offline



Posts: 33

Re: Having child notes inherit parent attribute values
Reply #6 - Oct 27th, 2008, 2:45pm
 
I tried to set up the following: a parent of prototype A, whose children are prototype B.

The idea is that I drop references from BibDesk in this container. But I cannot find exactly what makes the children get prototype B as an attribute automatically.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4635
Southsea, UK
Re: Having child notes inherit parent attribute values
Reply #7 - Oct 27th, 2008, 2:52pm
 
OK, so the container (of Prototype "A") should have any (new) children be of Prototype "B"? If so, make the container's OnAdd action:
 Prototype = "B";
The OnAdd action is the action taken on any new note - whether created from new or existing notes moved/dropped into the container.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
Willem Smelik
Full Member
*
Offline



Posts: 33

Re: Having child notes inherit parent attribute values
Reply #8 - Oct 27th, 2008, 3:09pm
 
I thought I tried that one; but I forgot the quotation marks... Indeed this is the simple answer I was looking for! Thanks so much
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4635
Southsea, UK
Re: Having child notes inherit parent attribute values
Reply #9 - Oct 27th, 2008, 5:59pm
 
If the Prototype name is a single name you might not need quotes but you will need them if the target (prototype) note name includes a space.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
Willem Smelik
Full Member
*
Offline



Posts: 33

Re: Having child notes inherit parent attribute values
Reply #10 - Oct 28th, 2008, 2:44pm
 
In this case, it includes a hyphen but not a space ("to-do")
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4635
Southsea, UK
Re: Having child notes inherit parent attribute values
Reply #11 - Oct 28th, 2008, 3:02pm
 
Ah, a hyphen is the same typed (if not intended) character as a minus.  TB probably thinks you're looking for a notes whose name is the results of subtracting the string "do" from the string "do". If you had a name of 'to+do' (without the quotes) the ambiguity might seem a bit clearer. To make plain to TB that the '-' in 'to-do' is a hyphen and not an expression minus operator enclose the whole name in double quotes, e.g. "to-do".

This is why, if uncertain you should enclose explicit text in double quotes. It stops TB having to guess, perhaps incorrectly, which of several possible interpretations of the input presented is the one you intended!


Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print