Spawning two templates to create second page, possible?

I am not sure if this is possible but based on a value on the first page i want to be able to create a second page using two templates.
My script below just creates two extra pages. Any ideas please?
var t = this.templates;
var j = this.pageNum;
// this is my 3 templates, depending on the value of the first page the second will pick 2 of these templates
    var T = t[0];
    var S = t[1];
    var R = t[2];
if (this.getField("P"+j+".Background.Dropdown4").value == "Other"){
    var XO = T.spawn(this.numPages, true, true);
    for (var i=0; i<0; i++) T.spawn(this.numPages, true, true, XO);
}else if (this.getField("P"+j+".Background.Dropdown4").value == "Hair Colour"){
        var XO = T.spawn(this.numPages, true, true);
        var XY = S.spawn(this.numPages, true, true);
    for (var i=0; i<0; i++) T.spawn(this.numPages, true, true, XO);
    for (var i=0; i<0; i++) S.spawn(this.numPages, true, true, XY);
this.pageNum++;
app.alert("A new page has been added")

Thanks for the comments, the loops were taken initially from the examples on the SDK site for another project which needed more than one page template, I've taken them out and retried with the bOverlay changed to false but it adds 3  templates of which two are the same?
Heres my modified colde, any help would be much appreciated:
var t = this.templates;
var j = this.pageNum;
    var T = t[0];
    var S = t[1];
    var R = t[2];
if (this.getField("P"+j+".Background.Dropdown4").value == "Other"){
    var XO = T.spawn(this.numPages, true, false);
    T.spawn(this.numPages, true, false, XO);
}else if (this.getField("P"+j+".Background.Dropdown4").value == "Hair Colour"){
        var XO = T.spawn(this.numPages, true, false);
        var XY = S.spawn(this.numPages, true, false);
    T.spawn(this.numPages, true, false, XO);
    S.spawn(this.numPages, true, false, XY);
this.pageNum++;
app.alert("A new page has been added")

Similar Messages

  • Using pages to create a two-sided brochure and second page prints upside down!

    When using a pages template to create a two-sided brochure, the second page needs to be reversed (upside down) for correct printing when emailing to an outside printer sources.  How do I reverse the page within the pages app?

    IF you are using a printer with 2-sided printing, in the expanded print dialog you will have a selection for long-edge binding OR short-edge binding. Whichever setting you have set, switch to the other one.
    Walt

  • Printed colour is different between two elements both created in pages with the same colour

    Hi There,
    I have been having some issues getting a text colour to match a logo (imported in pdf format) - While trying to discover what was happening I created a sample colour of (HSB 189 / 89 / 73) in pages and saved it in my colours palette to test.
    Now if I create some text (in pages) and a shape (also in pages) and colour them from the same colour sample/swatch and print it - the colours are clearly very different, Does pages do some kind of text colour correcting or weirdness that I cant find? Its hard to believe this is the desired workflow and its very anoying.
    PS. I have also tried printing from a pdf and I have the same issues - That said the two colours look identical in pages and the pdf on screen.
    I'd be extremely grateful for any help
    NB I have since read
    https://discussions.apple.com/message/9263007#9263007
    Which although is helpful and may explain the behavious of the imported logo pdf vs the text it doesn't (I dont think) explain how two elements both created in pages using the same colour (from pages) would be dfferent?

    They are both coming out at the exact same colour (CMYK 83, 0, 21, 0) which is correct however they are not the same colours when printed, Im begining to think this is less of a pages thing (as the output is correct) but something is going wrong between pdf/pages and print
    Its not the easiest thing to see so you may have to take my word for it - but the two colours are not the same by quite a long way (Theres way more contrast in real life)
    I think Im ready to admit defeat on this but thanks a bunch for your help!
    Brendan

  • Two template folders created??

    I am completely stumped.  I CANNOT update my child pages that are linked to templates.
    I am very new to Dreamweaver CS4 along with web design in general and have created a fairly straight-foward site (nothing fancy). 
    My confusion comes from Dreamweavers folder (path???) structure.  I have created two templates that are linked to the webpages but I have TWO template folders.
    I am certain I am getting the jargon wrong, but why did DW create two template folders and which one do I update and "put" onto my server?
    It seems nothing I do makes changes on my site and the more I read, the more confused I'm getting about the template path..lol..I am truely getting lost and flustered.
    I'm not even sure what information to include to assist in someone helping me.  If someone could explain the folder path in plain english I would be grateful.
    My folder structure looks like this:
    Site - nss
         File Uploads
         H&S Manual
         Inserts for Folders
         NSS Web
              Templates
         Templates
         Toolbox Talks
    There are more folders under NSS Web but I wanted to illustrate where DW has put the two Template folders.  Both template folders contain the same two template pages (.dwt files)
    Thank you in advance,
    Mike

    DW will place the templates folder under the root directory. While working in the NSS Web directory, DW has thought that NSS Web was the root directory.
    Personally I would use the template that resides within the Templates directory that resides under Site.
    This may help http://help.adobe.com/en_US/dreamweaver/cs/using/index.html
    Gramps

  • Remembering Template Changes for second page

    I have adapted the San Fransisco Letter template to suit my own needs, copying my own logo, and updating the address details. I have then saved the new template, and it appears in My Templates - so far so good! I have noticed though that when I go to a second page in my letter, the original San Fransisco Template appears - with the incorrect logo and address. Am I missing something? Is there a way for my Template changes to carry over to the second page? Thank you very much.

    Gwyn,
    Okay, now we're getting somewhere. The address area you're referring to is already defined as a master object. Here's what I did: I put my own address in that object, moved my cursor to the end of the page, then added a page break. Like your situation, the master object repeated on the next page (as a master object will), but it repeated with template information, and not the address I put in. That's what's happening to you. So I started over. I put in my address, moved my cursor to the end of the page, but instead of adding a page break, I added a section break -- voilá. It worked.
    What confused me for so long is that master objects usually just look for a page break in order to repeat. For some reason, yours is looking for a section break. Go figure. Anyway, now we know how to fix it. Good luck.
    -Dennis

  • How can I create second page in Pages document?

    In my Pages document, I've gotten to the bottom of the page and can't get a second page.

    If you are using the wprd processing document it will add a page when go continue to write.
    If you use a page layout document and have added a textbox to write your text you have to go Insert > Page > choose text or blank.

  • PSEv4: Templates for creating album pages

    My wife and I just got PSEv4, and have been having fun with the creation tools --specifically the photo album page creator.
    But (there's always a but)...
    We're already feeling like the templates available are limiting, and would like to have more options. So here's the question(s):
    Is there somewhere to download new templates that work with PSE?
    Is there a way to create templates that work with PSE?
    TIA

    Sorry but I do not know of any source for additional downloads or any directions for making your own templates that fit within the structure of the Album pages Creations of the Organizer.
    Under the Organizer
    Edit > Preferences > Services there is a button for Update Creations. Adobe has occasionally released additional templates; some of these have been for specific holiday templates. However, they still will be very limited.
    The Full Photo No Border style of the Album Pages creation allows you more flexibility in positioning and sizing both the photos and the text - but it is basically a blank page with no decorations.
    Now if instead, you use the Elements Editor blank canvas to make cards, you can totally customize what you use for decoration on the printed pages. You might search within these forums for methods of making cards within the Elements Editor.
    Barb O

  • How to create a second page?

    Hi. I want to create a second page and then call it from code and maybe with some transition effects when it is made current. Can you show me how? Thanks

    Hi,If you need to create second page in your project then select project right click and add new item .
    If you need to go second page when press click btn in Main/first page use-
    NavigationService.Navigate(new Uri("/SecondPage.xaml", UriKind.Relative));If you need to transition effects when it is made current find following link for helpful-http://www.geekchamp.com/articles/windows-phone-7-navigation-transitions-step-by-step-guidehttp://stackoverflow.com/questions/13440133/windows-phone-8-how-to-animate-page-navigationhttp://stackoverflow.com/questions/17021854/page-turning-transitions-for-windows-phone-8-appsDon't forget to mark the right answer and vote up if helps you.

  • Using a letterhead template for a multi-page document

    When using a letterhead template for a multipage document, how do I turn off the template for pages after the first page? I do not want to have the letterhead show up on every page of a letter.

    John,
    You can set new margins for your new section in the Layout Inspector. After removing the letterhead elements open the Layout Inspector, choose the Layout tab and set the margins as you need them.
    Once you've created and formatted the section to your liking, make it a permanent part of your template.
    1. With the cursor on the second page, go to Format>Advanced>Capture Pages
    2. Give the page a descriptive name, such as 'Second Page'. Include 'First page only.'
    3. Click 'Ok.'
    This 'Second Page' is now listed under the "Sections" icon on your toolbar.
    4. Save the document as a template.
    Now, whenever you start a new document based on this template add the second page using the Section Icon.
    There is a shortcoming to this method in that text will not flow from the first page to the second, given that there is a section break between the two pages. This would be the case even in Word. Of course, even in Word you could not change the margins for the second page without also changing the margins for the first page unless you used a section break.
    One way to avoid this problem is to but your address block for the first page into a page high text box and allow text to wrap around it. You can keep the same margins for the first and second page, but on the first page the text will be pushed over to the right. When it wraps to the second page, the text will return to the left margin.
    Good luck,
    Terry

  • How to: make a custom second page?

    Ladies, Gents,
    I almost have my custom template for my business correspondence ready, but there is one thing I cannot figure out how to do it...
    As with my normal (printed) stationary, my second page and onward have less information then my first one. In my case, just a logo. Much as is the case with the "Woodland letter" template in Pages '08. As soon as you hit enter at the end, the second page comes up with a smaller, simpler logo.
    I cannot figure out how to get this done? The manual states entering a section break, customizing it, and using File>Advanced>Capture pages, but as soon as I enter a section break, I just get a blank page. Copying or pasting a graphic adds ANOTHER page at the end... I am stumped, and having read the manual from page 1 to 240, I don't have a clue!
    Any help would be GREATLY appreciated!

    Oh! Now I see.
    Try this. Format your template WITH the second page included. Use either a page break or a number of returns to get to the second page. Reformat the second page with the appropriate header, footer, logo, etc. (This is where 'First page is different' comes in, I'm sure you know.) Once the second page looks the way you want, remove it by removing the page break or the hard returns, THEN save it as a template. Do NOT use a section break to create the second page. I don't think inserting a new page will work to modify the template in this case.
    BTW, you are using a word processing rather than a page layout document, I assume.
    Good luck,
    Terry

  • How do i create a page template in order to spawn new pages?

    How do i create a page template in order to spawn new pages?

    Where did you find the link/interface that led you to ask your question here?
    You should find the forum for whatever product your question involves and post there.
    Here is a link to a page that has links to all Adobe forums...
    Forum links page:
    http://forums.adobe.com/index.jspa

  • I used a pages template to create a poster/flyer is it possible to convert it to a jpeg?

    I used a pages template to create a poster/flyer is it possible to convert it to a jpeg?

    You can export it as a pdf. Then open the pdf with Preview and export is as a jpeg from there.     

  • Create data merged document with data on every second page?

    Is it possible to create a data merged document with the variable data only on every second page?
    I have set up the pages with the variable data as a master page (on every odd page) with the text box and paragraph style all set up, and I have set 'override master page items' so the data can be placed, but InDesign seems to freeze up when I try to create the merged document?

    There should be no problem doing the merge with a two-page master and a two-page template document with fields only on one page (and off the top of my head there's no reason to move them off the master page if that's where you put them). I think the problem here is that rachrachm already has a file of 500 pages (based on another thread asking how to apply masters to every other page).
    It's potentially possible to simply place the data file (without the header row) as a text file and auto-flow through the master page frames (can't say for sure without seeing the files), or if the pages without the merge fields are the same just, remove all but the first two pages from the template and do the merge.
    As I metioned earlier, though, this is a very inefficient method of producing that sort of document. A true variable data print flow would be better (you'd need to find a commercial printer who can do it with your data file), or the home version would be to make one single page file for the static content, print 250 copies (plus a few extras, just in case), then make a single page merge template, do the merge, and print that on the back of the already printed pages, or as a separate page. It is immeasurably faster to print multiple copies of a document than it is to print a document that has multiple identical pages.

  • How do I create a automatic second page with different layout settings?

    Hi there,
    I want to create a business letter template with a different second page. I already managed to create a different layout on page nr two, but
    whenever I write a letter with this template and I reach the end of page one, pages creates a thrid page in between my page nr one and nr two with a mixture of the layout of template page nr two and the footer of page nr one.
    I want pages to take my template page nr two (with different header and footer) as second page instead of creating one itself.
    If I don't need a second page - because my letter is to short - I should not have to delete a second page. It simply should not be there...
    Thanks for Help!
    G4's and 12" PB   Mac OS X (10.4.6)  

    Hello Stefan,
    you achieve this with a little trick. Create your letter and set the layout for the first and the second page by inserting a placeholder text. This placeholder text should fill the first page and the top of the second page, so both pages are build in one section. When the entire letter is layouted well, select the placeholder text and than save the letter as a template.
    Now every time you open this template, you only have to insert the main text (replace the placeholder text with real content), and the second page disappears until the main text overflows the borders of the first page. Than you will get the second page again with the layout you have created for it.
    I hope this will work for you like it works fine for me.

  • Is it possible to use an XML Data Template to create a report in APEX?

    Hi,
    I have created an XML Data Template in BI Publisher passing one parameter and running two queries, then created an RTF Document Template to present the data.
    I can create a nice report in BI Publisher using the two elements. I have used RTF Document Templates to publish reports in APEX but the data comes from a Report region running a single query.
    I would like to run a report based in this kind of XML Data Template, in order to use several children queries related to a parent query. Is it possible to do it in APEX, or you have to use BI Publisher?
    Francisco
    ===========================
    Below is a simple data template definition:
    <dataTemplate name="cotizacion_template" description="Prueba de data template para cotizaciones" dataSourceRef="dbxprts">
         <parameters>
              <parameter name="p_id_cotizacion" dataType="character" defaultValue="1009" include_in_output="true"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="header_query">
                   <![CDATA[select id_cotizacion, fecha_cotizacion, id_clipro from f_cotizaciones where id_cotizacion = :p_id_cotizacion]]>
              </sqlStatement>
              <sqlStatement name="detail_query">
                   <![CDATA[select id_cotizacion as id_cot_child, id_detalle_cotizacion, partida, cantidad, id_producto from f_detalle_cotizaciones where id_cotizacion = :id_cotizacion]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="F_COTIZACIONES" source="header_query">
                   <element name="ID_COTIZACION" value="ID_COTIZACION"/>
                   <element name="ID_CLIPRO" value="ID_CLIPRO"/>
                   <element name="SUMA_CANTIDAD" value="F_DETALLE_COTIZACIONES.CANTIDAD" function="SUM()"/>
                   <group name="F_DETALLE_COTIZACIONES" source="detail_query">
                        <element name="PARTIDA" value="PARTIDA"/>
                        <element name="CANTIDAD" value="CANTIDAD"/>
                        <element name="ID_PRODUCTO" value="ID_PRODUCTO"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>

    Hi,
    I have the similar question. I used data templates in BI Publisher but now I want to use the same data template in Apex to print some reports.
    I tried to some examples but these were only using report queries. I also tried with the Web Service but this didn't work for me either maybe because I didn't
    used it in the right way. When I used the WS I received the binary of the report so the WS worked it was just the how and where to use it that didn't work for me.
    Now this older entry is BUMPED maybe we find a solution for our problem this way.
    regards,
    Steven

Maybe you are looking for

  • Display text value characteristics in WEB-Layout

    Hi Experts, is it possible to display the text of a characteristic (NOT a variable) instead of the code in WEB Layout? Thanks to all. Fabio.

  • Import of structure of folders

    Hi I have a question in my  dev system I have created  many folders  then  my question is Can I import these structure from dev to QA on cfolders? Regards Danny

  • What is the current version of InDesign?

    What is the current version of InDesign?

  • SMS Picture messages won't save to my phone!

    Hi!  I am currently using my BlackBerry Curve 8520 on Virgin Mobile, and when my friends send me pictures of me when I click "Save Image" I click "save" and it says that it all saved well. But when I go to check it on the Media folder or put it as my

  • END_SQL parameter use in OLAP Universe?

    Folks, We normally use END_SQL in our Universe parameters /Document Name :@variable('DOCNAME'),User ID :@variable('BOUSER'),UNIVERSE :@variable('UNVNAME')/ for all our relational universes to track - which users are running long queries. We are curre