[Xerte] Re: simple presentation

Julian Tenney Julian.Tenney at nottingham.ac.uk
Mon Apr 4 10:22:32 BST 2011


Use getChildByName() to avoid having to know the structure / number of children.

Much better to say icon.parentNode.getChildByName("myProtoPageName") than to say icon.nextSibling() etc where if the structure changes, so does your code,

J

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Patricia Heijmen
Sent: 04 April 2011 09:10
To: Xerte discussion list
Subject: [Xerte] Re: simple presentation

Thank you Dave,

I am a bit further now. But still have some trouble.

Now I have :
the make pages icon, then the interface icon, the interface icon contains an entry frame, and the protopage. So I addes only an entry frame.

I made 3 pages with the template


I changed the code in the makepagesicon into:

icon.nextSibling.childNodes[2].duplicate(templateData.presentation[0].page.length - 1);

icon.nextSibling.attributes.title = templateData.presentation[0].name;

//set the page titles
for (i = 0; i < templateData.presentation[0].page.length; i++){
  icon.nextSibling.childNodes[i].attributes.title = templateData.presentation[0].page[i].name;
}


If I preview the presentation and I got only one page: Page 2. It contains the right text and picture but there should be 3 pages.

Then  I changed
icon.nextSibling.childNodes[2].duplicate(templateData.presentation[0].page.length - 1);
into
icon.nextSibling.childNodes[1].duplicate(templateData.presentation[0].page.length - 1);

Then with previewing I got 3 pages,  it doesn't show page 1, then it shows page 2 and 3 (with correct pictures and text) and then it shows a page undefined.

I should think icon.nextSibling.childNodes[2] is the protoPage? But why doesn't that work? and why do I get some result with icon.nextSibling.childNodes[1]? And why I don't get page 1 then?

Patricia




----- Original Message -----
From: Dave Burnett<mailto:d_b_burnett at hotmail.com>
To: Xerte list<mailto:xerte at lists.nottingham.ac.uk>
Sent: Friday, April 01, 2011 8:21 PM
Subject: [Xerte] Re: simple presentation


You have to be very careful around template architecture.

You see the script icon above the Interface icon called makePages?
Open it up and look at the first line of code.

icon.nextSibling.firstChild.duplicate(templateData.presentation[0].page.length - 1);

That is making the pages of your presentation:

icon = here, this icon
nextSibling = next icon downward
firstChild = next icon rightward
duplicate = duplicate

So it is saying, duplicate the protoPage icon x number of times.

When you insert your entry pane on to the Interface page, you have inserted a sibling between makePages and the target, protoPage.
So the relative logic is destroyed and the piece is not being built.

You would have to adjust all the relative references in the piece to take into account the added entrypane icon.

HTH
Dave











________________________________
From: patricia at e-w-i.nl
To: xerte at lists.nottingham.ac.uk
Date: Fri, 1 Apr 2011 18:23:44 +0200
Subject: [Xerte] simple presentation
Hi, I am very new in Xerte.
I am trying to understand the simple presentation template.
I would like to ad an entry frame to the interface icon and then add som cusom buttons.
However, when I insert an entry frame,  the application doesn't work correctly anymore. The text icon shows 'undefined' and I cannot go through the pages.
What I am doing wrong?

Thanks for any help
Patricia

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

_______________________________________________ Xerte mailing list Xerte at lists.nottingham.ac.uk http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
________________________________
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20110404/8f858996/attachment.html>


More information about the Xerte mailing list