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 
Send Topic Print
Export set up for logical efficient learning curve (Read 8374 times)
Dr Mark
Full Member
*
Offline



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #15 - Jul 16th, 2014, 2:00pm
 
Thanks Mark  - I appreciate your time on this. However I don't think it has worked - I have linked to a simplified tbx that just hones down on the few files ( sorry I meant to do that last time)

The issue appears to be with the nav note as the css file is rendering the HTML fine.

I can't seem to get the evaluation of childLinks() in the blog notes - if I use ^text as nav template I get <p>/</p> inserted and if I use ^value($Text) I get the literal childLinks() not the html that would actually create the links that might exist



https://www.dropbox.com/s/iuxzie4gbuk2jgm/Export%20tester%20Problem.tbx

Many thanks once again
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #16 - Jul 16th, 2014, 3:23pm
 
This is an ideal example of why I tell people not to use the option of unclosed export codes. It's not pedantry, as,

^childLinks()   <-- may give unexpected results, TB guesses end of code

^childLinks()^ <-- works as expected, code closes at last ^

Seriously, unless you're expert with TB or a very longterm user, just ignore advice that the closing ^ on codes is optional. If you leave it out, TB has to guess you're intent. Here it guesses wrongly.

So for 'nav', use ^childLinks()^ and the 'text only' template. As with CSS styles, this means to only content paragraph starts with a < and ends with a > in which case TB is savvy enough to not put <p> tags around it.

One other error even with the above fixes 'nav' does nothing until you actually add some children to it!

Before someone asks you can use ^childLinks^ instead of ^childLinks()^. The brackets are only mandatory if using any input parameters. The key thing is to always close your expert codes with a ^ (caret - shift+6).
Back to top
 
 

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #17 - Jul 16th, 2014, 4:08pm
 
Once again many thanks and I hope others are learning some stuff here as starting to feel a little guilty!

I now realise that although it is 'working' it isn't working how I wanted it too! It was your comment about nav having to have children that confused and then enlightened me - I had wanted nav to simply result in the blog posts listing their children not the children of nav  - I see now that I can put ^childLinks()^ into the blog template for the same result

I had an idea that nav would be useful if I wanted to later change the type of links displayed

the footer note simply adds its text to the template - nut nav seems to not add its ^code^ in the same way - hence the need to put it in directly
?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #18 - Jul 16th, 2014, 5:29pm
 
Your footer exports correctly if you use 'text only'. The note has two paragraphs and exports 2 paragraphs.

Of, course if you don't want separate paragraphs there, then you need to consider using CSS to style footer paragraphs, or such like. This isn't a WYSIWYG HTML design environment and thus you need to figure out the styling/mark-up you want, then implement it.  a good approach is to make a static page that 'tear down' the HTML into as many templates & pieces of boilerplate as you need.
Back to top
 
 

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #19 - Jul 16th, 2014, 7:17pm
 
Yes I see that logic thanks. However why does nav fail where footer succeeds?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #20 - Jul 17th, 2014, 3:07am
 
"why does nav fail". That's not much to go on - can't can you explain what you expect vs what you get? [edit - slip of the pen quite misrepresented the tone of my question - sorry].

As written, 'nav' sets the relative link from nav to each of its children. The include elsewhere pulls that HTML. The included HTML is still using the relative link from
nav to its child rather than - as you assume - the relative link from some other note to nav.

However, I think you're overcomplicating the nav structure. Let's assume you have a Home page and an About page, both of which are exporting TB notes and to which you want navbar links. Let's also assume that for whatever reason you don't yet know where in the site (i.e. at root level or below) that those pages will live. But you also want all exported pages' navbars to have correct relative links to those two pages. In which case, your nav code is this boilerplate:

^linkTo("Home")^ | ^linkTo("About")^

This assumes Home and About are unique note names, if not cite their whole path. Note too that nave now needs no children to act as placeholders for the target links. That said, Home and About could be child notes of nav but as TB exports static structures it would make much sense to do so.

Changing the nav content.  If 'Home' changed it's note name to home page, simply update the link code to ^linkTo("Home Page")^. If the note kept the same name but you set it to use a different exporting HTML filename, no change is needed.

This method is as easy to maintain as fiddling with child notes and avoids the relative linking problem stated at outset.
Back to top
 
« Last Edit: Jul 17th, 2014, 5:44pm by Mark Anderson »  

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #21 - Jul 17th, 2014, 4:31pm
 
Thanks Mark - Sorry I wan't trying to be obtuse and your further explanation is very helpful.

In a sense I wasn't trying to do anything 'real' with my export tbx file just trying to experiment with include and some linking code and learn from the mistakes. My learning tends to be jump in and swim style and on this occasion I drowned!

^linkTo("Home")^ | ^linkTo("About")^

is actually perfect for some blog pages I am planning

Many thanks once again
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #22 - Jul 17th, 2014, 5:42pm
 
My best suggestion for a learning/experimentation exercise is perhaps  counter-intuitive at fist sight. I suggest finding an HTML page you like (or have made) and reverse engineer it into into TB templates. It was only when I did that that I first really got a good handle on TB & HTML export. Admittedly, that approach assumes some familiarity with reading HTML codes (not everyone's cup of tea!).

Apologies for the opening question of my last, a negative missed in proofing made my opening question brusque in a manner I'd not intended.  (I find the reversed out drafting box for the forum hard to read)
Back to top
 
« Last Edit: Jul 17th, 2014, 5:46pm by Mark Anderson »  

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #23 - Jul 17th, 2014, 6:54pm
 
Yes that is a good idea - I have been looking at css files and html templates available on the web and I'm looking at the div tag and how web pages are divided up into typical areas ( top,footer,main,left side bar etc...) which seems ideal for TB template/bolierplate.

No offence taken Smiley
Back to top
 
 
  IP Logged
Pages: 1 2 
Send Topic Print