Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1 2 3 4 5 6 
Send Topic Print
Making an HTML outline (expandable/contractible) (Read 84901 times)
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #45 - Jan 2nd, 2010, 5:41pm
 
My experiments show that the linkage works when target note is a child (not a descendant, but just a child) of the note that contains the text link:


However, I noticed that the target note is in /Def , and not (curiously) /outliner (which was supposed to be the target). This might indicate a problem with ambiguity... or not... I'm confused...
Back to top
 
« Last Edit: Jan 02nd, 2010, 5:47pm by Marcelo Mirage »  
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Making an HTML outline (expandable/contractible)
Reply #46 - Jan 2nd, 2010, 5:45pm
 
OK, so '1' links to '2'. But it is exported twice.  Once as '2.html' and once as part of Outliner.html, which use the include ^children(list-item)^.  So to which version of '2/ does '1' link?

I think that in template 'OUTLINER_TEMPLATE' , instead of
  ^Children(list_item)
…you meant to use:
  ^childLinks^

See: ^children^, ^childLinks^
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #47 - Jan 2nd, 2010, 6:01pm
 
Sorry, Mark... I'm not sure I understood your observation.

1. Note '1' is exported twice? Yes, it IS part of outliner.html (only ^title^ is exported, though), but its ^text^ (which contains the link) is only exported as /Def/1.html

2. Notice that the /Oultiner container is NOT to be exported AS A FOLDER (The children will be exported individually in /Def, but /Outliner itself will only be exported as outliner.html)

3. Why would I use ^childLinks instead of ^Children? The /outliner container's only purpose is to export itself, as "outliner.html", which is to become the left frame. At least I'm getting exactly the result I expected using ^Children
Back to top
 
« Last Edit: Jan 2nd, 2010, 9:16pm by Marcelo Mirage »  
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #48 - Jan 2nd, 2010, 6:27pm
 
Besides, I've just noticed, the outliner_template is NOT USED by any note. It can be deleted altogether. (actually, "/outliner" uses "sitemap" as template)
Back to top
 
« Last Edit: Jan 2nd, 2010, 6:28pm by Marcelo Mirage »  
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Making an HTML outline (expandable/contractible)
Reply #49 - Jan 2nd, 2010, 6:56pm
 
No, OUTLINER is exported as 'outliner.html' - take another look at the code. Earlier, I cited the wrong template name but the problem is the same as the 'sitemap' template has this line:
  ^Children(/Templates/sitemap-titles)
…which is effective telling Tinderbox to include [sic] every children of the current note using the template 'sitemap-title.

Even though the 'sitemap-titles' template only uses each note's title, it is still an include within the file exported a 'outliner.hmtl'. So, the notes '1', '2', etc., are all exported at least twice - once as standalone and once as an include within 'outliner.html.

A number of export codes, as listed here, result in an include on export.

In order to achieve the left-pane hierarchy you want, you probably need to try ^linkTo^ rather than ^childLinks^ as the latter gives a plain HTML list.
Back to top
 
« Last Edit: Jan 2nd, 2010, 6:58pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #50 - Jan 2nd, 2010, 8:54pm
 
Ok. It was about time I revised the whole document.

I realized there were a bunch of unnecessary notes. Things work as usual, but document structure now is much clearer.

Here's a temporary link to version 3: http://dl.dropbox.com/u/76377/TinderboxForum/Outliner%26TextFrame_v3.tbx.zip Until Mark B. can update it in the PFE.

@Mark A.
Still... I cannot figure out a way to implement text links' automatic conversion to weblinks. If you can think of a solution, Mark... I still don't see how ^linkTo^ can replace ^children^ in the sitemap template... pardon my sloooow neurons...
Back to top
 
« Last Edit: Jan 2nd, 2010, 9:10pm by Marcelo Mirage »  
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #51 - Jan 2nd, 2010, 9:26pm
 
Quote:
Even though the 'sitemap-titles' template only uses each note's title, it is still an include within the file exported a 'outliner.hmtl'. So, the notes '1', '2', etc., are all exported at least twice - once as standalone and once as an include within 'outliner.html.


If that's true, why is it that SOME links DO get assigned with an <a href> (only children)? Since every note is exported twice, NO links should be converted, right?

But take a look at version 3. Export the result and check note "1" in your browser. See the links for the first two (because they're children of "1")? See the links for descendant notes not working? ONLY immediate children convert links.
Back to top
 
 
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #52 - Jan 2nd, 2010, 9:39pm
 
Concerning Outliner&TextFrame_v3.tbx, there's a strange export behavior: in order to have ALL the files exported correctly, you must export it TWICE (notice that the first time will only export 1 file into /css, for instance)... go figure...
Back to top
 
 
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #53 - Jan 2nd, 2010, 9:52pm
 
EUREKA!!!

Don't ask me why, but here's the solution: when you want a text link to become a weblink, you must link the selected text to the desired note's ALIAS, INSIDE /Def, and not to the original note!!!

GO FIGURE! I have no idea why this works, but it just does! I've updated v3. Check note "1" and see that all the links work properly!!!

WHY, o, WHY?
Back to top
 
 
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #54 - Jan 2nd, 2010, 10:15pm
 
Ok, I'm about to start a new topic, as this one got too long and full of dead ends. It's still nice to see all the work in progress.

But before that, I'd like to find out:

1. Why must this particular document be exported TWICE in order to have ALL the files exported?

2. Why do text links get converted to weblinks when (and only when) the selected text is linked to an alias inside /Def, but don't get converted when it's linked to the original note (inside /Outliner)? (I guess only Mark B. might be able to crack this one).

As soon as the two questions are answered, I'll start a new topic only to explain the workings of the template and its strange idiosyncrasies.

Here's the expected result, so far: http://dl.dropbox.com/u/76377/TinderboxForum/Export/index.html
Back to top
 
« Last Edit: Jan 2nd, 2010, 10:51pm by Marcelo Mirage »  
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Making an HTML outline (expandable/contractible)
Reply #55 - Jan 3rd, 2010, 11:03am
 
#1. Some pages are only exported twice because you, as the TBX's author coded it that way. Tinderbox exports what you tell it to export.

#2. You're confusing aliases with includes. An alias exports to HTML as a separate note with it's own inbound and outbound basic links - not those of its original - plus the original's text links (as both share the same text). Re includes: a note is exported normally only once, to its place in the export hierarchy plus it gets exported again if you (a) use one of the group of include export codes I mentioned earlier and (b) the note falls within the scope of such an include.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Making an HTML outline (expandable/contractible)
Reply #56 - Jan 3rd, 2010, 12:18pm
 
It occurred to me that aTbRef's sitemap ought to suffer the same problem, but doesn't. You can download the TBX. The note that creates the sitemap is called "aTbRef Site Map", third from last in the root level outline. That file is exported the once, using template 'sitemap' (in the TBX). The relevant part is this code:

Code:
<ul>^include(A Tinderbox Reference File,/TEMPLATES/sitemap-titles)^</ul> 


The 'A Tinderbox Reference File' note is the parent note to all exportable content. so what does (internal) template 'sitemap-titles' do.

Code:
<li>^linkTo(this)^
^if($ChildCount & $HTMLExportChildren)^<ul>^children(/TEMPLATES/sitemap-titles)^</ul>^endIf^</li> 


Although ^children^ is used, the child notes aren't actually included - all we do is use a reference to them  - the ^linkTo^. I suspect that where I to use anything like ^text^ or ^title^ in the latter template, I'd have the same problem at Marcelo's outline.

Anyway, I'd suggest taking a look at my TBX and the sitemap code and applying the same to yours. I've not time to fix everything but see my modified version of your outliner, here. Nottice how we move the notes from 'Outliner' to a new container 'Def'. This allows us to achieve the same trick as aTbRef. BUT, there is a new problem, links clicking in the left pane load their result in the left pane.

The problem is that ^linkTo()^ syntax doesn't allow us to add the code to target the right =-hand frame.  The fix to that - which I'll leave for you - is to use unobtrusive JavaScript to make all links inside the Outliner page use a target pointing links to the right frame. A benison of being forced to do this is it is the modern style of doing such things - inline 'target' attributes don't validate under some DTDs.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #57 - Jan 3rd, 2010, 1:09pm
 
But Mark, the fact is that the template is working just fine without any modification to sitemap!

I have already exported a few documents and had no problem with the outcome.

I think we're dealing with different problems here. I'm assuming you think the template is not working properly. But it is, even v1 and v2, with all the unecessary elements, still worked. v3 is fine too. The ONLY issue was that text links didn't export as <a> tags, so copying notes from one document to the template would not preserve, nor even allow weblinks. In my last posts, I just wanted to implement the possibility of automatically assigning text links to weblinks, that's all. It turned out, it worked the way I described in the previous post.

Back to top
 
 
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Making an HTML outline (expandable/contractible)
Reply #58 - Jan 3rd, 2010, 3:48pm
 
OK, you have me totally confused.  Your previous post asked for help on two problems which you now say don't exist.  I guess we're all fixed then.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Marcelo Mirage
Full Member
*
Offline



Posts: 133
Brazil
Re: Making an HTML outline (expandable/contractible)
Reply #59 - Jan 3rd, 2010, 6:30pm
 
LOL

Well, the two problems I mentioned STILL exist, but they're not what you were trying to solve:

1. The export question: what happens to the document that I need to export TWICE (i.e., I must run shift + cmd + H twice) in order to have all the notes correctly exported (try it: check the export result, check, for example, the /css folder, notice that only ONE file was created, not THREE as it should. Now, try exporting once again, and you'll see all the notes in place). AH, now I see what the confusion was about: you thought I was talking about the notes being exported twice, one as part of outliner.html, the other as a standalone note at /Def, which is fine.

2. The strange fact that if I link a selected text to the original note, it won't become an anchor tag. But if I link the same selection to the ALIAS in /Def, it will work properly.

I'll take some screenshots to illustrate what I mean.
Back to top
 
 
Marcelo Mirage Marcelo Mirage MMUmeda misantropov@yahoo.com   IP Logged
Pages: 1 2 3 4 5 6 
Send Topic Print