[Xerte] Re: Page template, Optional Parameter 'Text Width' of Plain Text doesn't work

Julian Tenney Julian.Tenney at nottingham.ac.uk
Mon Dec 12 09:28:54 GMT 2011


Can you check that in please.

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Kemp Johnathan
Sent: 11 December 2011 21:53
To: Xerte discussion list
Subject: [Xerte] Re: Page template, Optional Parameter 'Text Width' of Plain Text doesn't work

Hello Inge,

If you look at the model file you will see that there is a decision icon offering two pages.

The first page has a text icon which has a width set to 550, the second page has a component icon.

Above the decision icon is a script. In the script a path variable is set to 1 if subsuper is  true and 0 otherwise.

Since the decision icon branch property is set to calculate, the decision icon will display the page indexed by the path property i.e. the page with text if path is 0 and the page with the component if path is set to 1.

If you have added and checked the Superscript Support optional property then the text will be displayed in the  swf called by the component and any textWidth setting will be ignored.

If you have not checked the text width property then the Decision icon will display the page with the Text Icon

In your getPageID script there should be the following block of code

if (pageIcon.templateData.text[0].textWidth != undefined){
// icon.nextSibling.attributes.w = pageIcon.templateData.text[0].textWidth;
// added to directly set the width of the text display
icon.nextSibling.firstChild.firstChild.attributes.w = pageIcon.templateData.text[0].textWidth;
}

The commented out line that starts

//icon.nextSibling

is the original line that used to set the width of the text icon but this was compromised by the addition to the script of the Decision icon to accommodate handling Superscript by use of a swf.

The following line was added to provide the correct relative path to the text icon in its new position inside the decision, to set its text width.

icon.nextSibling.firstChild.firstChild.attributes.w = pageIcon.templateData.text[0].textWidth;

 If your model file lacks this line (I believe it is included in Xerte 2.17) then the textWidth property will fail to get its width set correctly.

Whist the xwd file displays text values to the user e.g.   Small, Medium, Large, Full the data returned by the xwd is a number 300,450,600,760.

So in a nutshell, the xwd returns a number and the line icon.nextSibling.firstChild etc. sets the width value of the text icon. But this will be irrelevant if you check the Support Superscript box, or if your model file lacks the correction to the relative path to the textIcon.

I hope this sorts it out for you.

Kind regards

Johnathan

On 11 December 2011 13:52, Inge Donkervoort <i.donkervoort at tor.nl<mailto:i.donkervoort at tor.nl>> wrote:
Hi,

The optional parameter 'Text Width' of the Plain Text Page Template doesn't work. I looked in the model file and the width of the text box is set to 550.  How is this suppost to work?

Bye,
Inge
1 2 Change
Chopinlaan 27
5242 HM Rosmalen
T 073-5226195
F 073-5226196
E i.donkervoort at 12change.eu<mailto:i.donkervoort at 12change.eu>
I www.12change.eu<http://www.12change.eu>

T twitter<http://twitter.com/IngeDonke12C>
L linkedIn<http://nl.linkedin.com/pub/inge-donkervoort/7/4b/18a>




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<mailto: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/20111212/2515c9a7/attachment.html>


More information about the Xerte mailing list