Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Tinderbox applications >> Inheritance in map view
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1370527727

Message started by Lew Friedland on Jun 6th, 2013, 10:08am

Title: Inheritance in map view
Post by Lew Friedland on Jun 6th, 2013, 10:08am

Mark or Mark, feel free to redirect me to another thread if more appropriate.

[I've bumped this to a separate thread as we're really discussing actions rather than the more general topic. Split from this thread at post #9. Mark A]

Am also working on an academic book project and I believe that Sumner has pointed to the answer to a problem. As I am taking notes on readings (books), I set up a set of OnAdd criteria for each book; chapters are then added to the book note inheriting key attributes (title, etc.). áI then set the master chapter note with an OnAdd for the chapter title. But then, in maps, I am at the same level, so OnAdd does not work to add the chapter title unless I go up a level and drag a note into the original chapter note. áSumner points to a syntax that will allow each level to inherit its parent's attributes, the $Title|=$Title(parent).
I have just created a set of attributes that seems to work at the lowest level:
$Prototype|=$Prototype(parent);$Author|=$Author(parent);$Chapter|=$Chapter(parent);$Title|=$Title(parent); $Publisher|=$Publisher(parent);$PubDate|=$PubDate(parent);

This is great, but I want to understand why and how it is working.
Can someone point me to a thread that explains this form of inheritance?

Also, I tried to create a QuickStamp with this syntax, but cannot actually apply it when a note is open and I try to invoke it in the OnAdd section of the note because the QuickStamp menu is not available. Obviously, I can copy and paste, but is there a better solution?

Thanks as always.

Title: Re: sprawling non-fiction project: ideas?
Post by Mark Anderson on Jun 6th, 2013, 11:26am

If you are viewing a map, and add a note, the $OnAdd of the map's parent container is run when a note is added to the map. Thus consider us looking at a map of a chapter notes, i.e. 'Note about ch15' and siblings - the children in  layout below:

Chapter 15
   Note about ch15
   Another note re ch15

When adding a new note to the current map it is the $OnAdd of 'Chapter 15' that gets run. I'll admit to being a little unclear as to your file's hierarchy. What relationship to the chapter are notes about it? Parent/child or siblings.  In the latter case the Chapter's $OnAdd wouldn't be invoked.

For any note - via code inherited or set locally - to set $MyAttribute to that of it's parent:

$MyAttribute = $MyAttribute(parent)

If the code is running in or on and alias we get the parent of the alias unless we use:

$MyAttribute = $MyAttribute(parent(original))

Does that help? If not please ask. I'll bump this to a separate thread as we're really discussing actions rather than the more general topic.

Title: Re: Inheritance in map view
Post by Mark Anderson on Jun 6th, 2013, 11:54am

You might find this article on the Hierarchy of Contents to be of use.



In the image above, selecting 'Grandparent' and open a new map (Cmd+Opt+M) would show a map with one item that is itself a container. Opening a map on a note opens a map of the contents of its patent container. This is logical, it is the map which shows the item we have selected. If we select 'First Sibling', then the map shows 3 siblings all of which are just notes.  And so onů

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.