Change Master Page based on Text Content

Hello,
I have found a few examples relating to changing Master pages based on Style.
However, I would like to change all Pages that flag "True" with the query of the "2-1134" to to "Master-C" for example.
I have 12 master Pages with different strings that I don't mind editing the script to make work.
The document is close to 1,000 pages.
I am having trouble merging so many different scripts into something that will work.
Platform: Indesign CS4 6.0.5 - OS X (Intel)
Thank you so much for your input, help and guidence.

This is what layers are for. Open the Layers panel and make at least one more layer. Put the graphic on the lower layer and the footer on the upper layer.

Similar Messages

  • Change master page

    I'm using indesign CS3 with javascript.
    I have a document with 11 chapters, every chapter has the same Master-page.
    Every chapter has 1,2, ..pages, the master page for the content in the chapter is not the same as the chapter Master-page.
    Every content from a chapter has a different master page, than the content from an other chapter.
    this means that i have 12 master-pages
    example:
    Chapter 1:           master-page A
         content1:       master-pageB
    Chapter2:           master-page A
         content2:       master-page C
    Every title from the chapter and content will be placed into a running header with a specifiek paragraph style.
    At the moment i have a little javascript, this script checks on every page for the paragraph style from a chapter.
    and the "master-page A" will bee placed on the right page.
    how can i extend my script for  the content master-pages?
    Is it possible that i can retrieve the text from the running header from the chapters?
    greetz,
    kim

    You can update the master page programmatically based on the variables you have
    SPSite site new SPSite("http://Foo");
    SPWeb web=site.OpenWeb();
    rootWeb.CustomMasterUrl = rootWeb.ServerRelativeUrl + "/_catalogs/masterpage/blueband.master";
    rootWeb.update();
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/2401df2d-ed12-45c6-acd9-40163e7f8515/changing-master-page-programmatically
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Changing Master Page in Project server 2013

    hi,
    Can any one help me how to change the project server 2013 master page ?

    Hello,
    Yes i want to modify the master page for  Project Web Access . i want to change master page for
    all application page in pwa. i did this successfully  in Porject serevr 2010 by modifying V4.master page. i approached the same way
    in 2013 but could not succeed. 
    is there any way to accomplish this?
    thanks.

  • Need to apply table fill color based on text content

    Totally new to Indesign-scripting – but really need a solution to this:
    I have a table
    I want to fill the table cell with a different color based on text content.
    If cell contents the text "Apple" fill color of cell should be color swatch "Red"
    If cell contents the text "Banana" fill color of cell should be color swatch "Yellow"
    Any help most appriciated!

    Hi Franke,
    Try the below code, may it will helpful:
    var myDoc = app.activeDocument
    //var myCell = app.activeDocument.textFrames.everyItem().tables.everyItem().cells.everyItem().getElement s()
    app.findTextPreferences = app.changeTextPreferences = null
    app.findTextPreferences.findWhat = "Apple"
    var myFound = myDoc.findText()
    for(i=0; i<myFound.length; i++)
        if(myFound[i].parent.constructor.name == "Cell")
        myFound[i].parent.fillColor = "aaa"
    If the above code helps you, then please give Helpful or Correct Answers.
    Because for the last 3 months only I started my Indesign Scripting Career.
    With the help of Forum legends I can able to reply for simple questions.
    Thanks all...
    Regards
    BEGINNER

  • Dynamic page based on directory content/structure

    I'm trying to build a web page based the content of a directory. I'm going to try and explain this as briefly as possible, yet still make sense.
    There are many more file than this, but an example of the directory of the index.html's looks like this:
    e:\Inetpub\wwwroot\Courses\Dev\Environmental Management Systems\Content\Install\Templates\en\index.html
    e:\Inetpub\wwwroot\Courses\Dev\Environmental Management Systems\Content\player\index.html
    e:\Inetpub\wwwroot\Courses\Dev\Environmental Management Systems\Content\scp\index.html
    e:\Inetpub\wwwroot\Courses\Dev\Environmental Management Systems\index.html
    With this structure, the root path is: e:\Inetpub\wwwroot\Courses.
    Dev would become a main section.
    Environmental Management Systems would become a Course title, because it has an index.html.
    I want to ignore the rest of the index.html's underneath.
    A caveat to this, is I need it to possibly go one level deeper.
    e:\Inetpub\wwwroot\Courses\Dev2\Manufacturing\Environmental Management Systems\Content\Install\Templates\en\index.html
    e:\Inetpub\wwwroot\Courses\Dev2\Manufacturing\Environmental Management Systems\Content\player\index.html
    e:\Inetpub\wwwroot\Courses\Dev2\Manufacturing\Environmental Management Systems\Content\scp\index.html
    e:\Inetpub\wwwroot\Courses\Dev2\Manufacturing\Environmental Management Systems\index.html
    Here, Dev2 becomes main section
    Manufacturing becomes sub section
    Environmental Management Systems would become a Course title, because it has an index.html.
    Of course there are a lot more files, which is part of the problem I'm having. Right now it takes about 8 seconds to read all the files, which is too long for building a page. Once I get all the main, subs, and Courses determined, I would then build the page, using some kind of menu.
    Below is the code I have that searches all files under a parent folder, I'm just not sure how to make it stop once it finds the correct index.html. I started to put in a recursive stop, but haven't quite figured out how to implement that either.
    Any help is greatly appreciated. I'm open to any and all suggestions. Btw, the intention here, is that the person that manages these courses can just ftp a new course directory to the server, and it's then available.
    Thanks,
    James
    <%@ page import="java.util.*,java.io.*,java.text.*,java.io.File,java.net.*" %>
    <HTML>
    <HEAD><TITLE>Skillsoft Courses</TITLE></HEAD>
    <BODY BGCOLOR="white">
    <H1><B><img src="logo.gif" width="120" height="49"><FONT COLOR=#004685>Courses</FONT></B></H1>
    <HR>
    <BR>
    <%!
         public ArrayList listFiles(ArrayList files, String currentFile, int recurse)
                   File fd = new File(currentFile);
                   if ( fd.exists() && fd.isFile())
                        //grab filename - not quite working right as it still prints out the ones that should be excluded
                        if ((currentFile.endsWith("index.html")) && (!(currentFile.endsWith("Content\\scp\\index.html")) || !(currentFile.endsWith("Content\\player\\index.html"))))
                             files.add(currentFile);
                   else if ( fd.exists() && fd.isDirectory())
                        File [] fileList = fd.listFiles();
                        // Loop through File array and display.
                        for (int i = 0; i < fileList.length; i++)
                             listFiles(files, fileList.getPath(), recurse);
                        } // for loop
              return files;
    %>
    <%
         ArrayList files = new ArrayList();
         String rootPath = "e:\\Inetpub\\wwwroot\\Courses\\";           
         //get file list of root path
         File dir = new File(rootPath);
         File[] children = dir.listFiles();
         //stick into array
         for (int i = 0; i < children.length; i++)
              int recurse = 0;
              String tmp = children[i].getPath();
              listFiles(files, tmp, recurse);
         for (int j = 0; j < files.size(); j++)
    %>
              <%=(String)files.get(j)%><BR>
              <%;
    %>
    </BODY>
    </HTML>

    Architecturally, I would not put this code in a JSP, put it in a Plain Old Java Object that gets called by a Servlet, builds the tree, then passes the tree to the JSP for display. It will make things easier in the long run.
    I would also look into caching the results. When you traverse the directory structure, hold the results in memory. Use a timestamp that records the last time the \Courses\ directory was traversed, and compare it to the \Courses\ last modified time. If \Courses\ was modified after the timestanp then re-load the content. This would reduce that 8 second load time to only occur when changes were made.
    Similarly, you could further reduce loading time by
    1) Compare a section with those sections already loaded. If it doesn't exist, then traverse it and add the directory structure
    2) If the section does exist, use a timestamp and modified time to see if it the section has changed. If it has changed, traverse it and update the directory structure
    3) If the section does exist and hasn't been modified, leave it alone.
    You would then want to make classes to represent the entire tree of files - which would contain a timestamp and a list of sections (main sections). Each section would have a timestamp, a list of sub-sections, and a list of courses. A course would have a timestamp and a list of files for the course. And as was mentioned this tree structure would be held in memory and returned as needed.
    For viewing files that are too deep in the structure, that will take more looking into than I have time for now. Sorry.

  • Changing Master Type Color While Retaining Content

    I'm trying to set up a document now that has a footer and page number along the bottom. This is defined in a master page and lets say the type is black. Occassionally the footer will be on a dark image and I would like to change it to white. I can override the footer and change the color but it'll no longer update the content if I change it in the master. I does still retains all the text frame properties such as postion but none of the actuall type settings.
    Is there away to have master type with different colors?

    SRiegel has your answer - if you have text variables, then they will do exactly what you want. The basic idea is that InDesign treats text and objects according to different rules, and you were hoping that this particular rule:
    "If you base Master B on Master A, then anything from Master A that is unchanged in Master B will be updated automatically when you change them in Master A."
    would apply to the text too. As you discovered, it does not:
    "If you base Master B on Master A, then any objects from Master A that are unchanged in Master B will be updated automatically when you change them in Master A."
    edited for spelling

  • Hiding a master page based on condition

    Hi All,
    I have created a form which has data on odd pages and some terms and condition on the back pages(even) pages. I am using Adobe Livecycle Designer ES version 8.1.2
    For this I created 4 Master pages.
    FirstPage - Pagination -> Odd/Even - > Odd (front) pages
                                       Placement -> First Page (in Page set)
    Front Page - Pagination -> Odd/Even - > Odd (front) pages
                                       Placement -> Rest of pages
    BackPage - Pagination -> Odd/Even - > Even (Back) pages
                                       Placement -> Rest of pages
    Dummy - Pagination -> Odd/Even - > Blank page
    I dragged the content area of back page on the dummy page.
    This set up works fine for printing.
    I have additional requirement of archiving, emailing and faxing. While sending a email or fax or archiving, the data should be continuous, the 'BackPage' master page should be removed otherwise they show in alternate pages as blank pages even if i set the presence property to 'visible(print only)' .
    Are there any settings which can be done to remove the master pages that are not needed based on a codition. Or can we achieve it through scripting.
    Regards
    Neha

    Hi Otto,
    I will try explaining the scenario...
    The form has to support back side printing and will be archived, sent by mail and by fax.
    The main content of the form will be on the front pages only and on the back side of the first page, the terms and conditions are printed.
    the rest of the back pages remain blank.
    Following the solution in the link below:
    ADOBE: How to print a table only on uneven pages and a text on the back?
    MasterPage -> Object pallete -> Page set -> Printing -> Print on both sides.(choosing this does not allow to set the occurance)
    I created 4 master pages.
    FirstPage -      Pagination -> Odd/Even - > Odd (front) pages
              Placement -> First Page (in Page set)
              Content area -> C1
    Front Page -      Pagination -> Odd/Even - > Odd (front) pages
              Placement -> Rest of pages
              Content area -> C2
    BackPage -      Pagination -> Odd/Even - > Even (Back) pages
              Placement -> Rest of pages
    Dummy -      Pagination -> Odd/Even - > Blank page
              Content area -> C3 (Dragged the content area of BackPage to the dummy page)
    I only have one Body page for now for the content and have put the terms and condition on the 'BackPage' master page itself as a text.
    (If I create a Body Page for the terms and condition (so that I can set its visiblity property) and I try to assign the content area of 'BackPage' (now on dummyPage) the designer shuts down with an error.)
    This works fine for the print set up.
    Now when I save the form, after each front page a blank page is inserted.
    I would like to remove this blank page.
    Is there any other way to have content on front pages only and print certain text only at the back.
    Please help.
    Regards
    Neha

  • Master page based on master

    Hi everyone,
    I have a master page that contains just the footer information for a publication I'm working on. I then have a second master that's based on the first master. On this second master I've created a large colored graphic rectangle that fills the entire page. Since it's covering the entire page, I can no longer see the footer beneath (ie. the one that's on the first master page). The only way to have the footer appear above the rectangle is to override the footer and then bring it to front. This though, defeats the purpose of having the footer on a separate master. Since there will be a lot of other secondary masters based on the first master with the footer, I wanted to keep the footer information intact so that I could revise just one footer and have all the other masters based on it, update automatically.
    I wondered if anyone knows of a workaround for this problem?
    Really appreciate any help.

    This is what layers are for. Open the Layers panel and make at least one more layer. Put the graphic on the lower layer and the footer on the upper layer.

  • Change Master page of a site using ECMA Script in sharepoint 2010

    Hi All,
    I'm working on SharePoint 2010.
    I have a requirement where in I need to create a site and apply a particular master page to the newly created site using
    ECMA Script.
    The site gets created but while applying the master page it gives me an error stating the method 'set_masterUrl' is not defined.
    Here is my code:
    $(document).ready(function () {
    ExecuteOrDelayUntilScriptLoaded(createSite, "sp.js"); //This is used to ensure until sp.js is loaded, createSite will not be executed.
    function createSite() {
    var context = SP.ClientContext.get_current();
    var collWeb = context.get_web().get_webs();
    var webCreationInfo = new SP.WebCreationInformation();
    webCreationInfo.set_title('TestSite');
    webCreationInfo.set_description('Description of new Web site...');
    webCreationInfo.set_language(1033);
    webCreationInfo.set_webTemplate('STS#0');
    webCreationInfo.set_url('TestSite');
    webCreationInfo.set_useSamePermissionsAsParentSite(false);
    var oNewWebsite = collWeb.add(webCreationInfo);
    context.load(oNewWebsite);
    context.executeQueryAsync(Onsuccess, onfail);
    function Onsuccess() {
    dummy(context, oNewWebsite);
    function onfail(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    function dummy(context,oNewWebsite)
    var strMasterPageUrl = '/_catalogs/masterpage/Test.master';
    oNewWebsite.set_masterUrl(strMasterPageUrl);
    oNewWebsite.set_customMasterUrl(strMasterPageUrl);
    oNewWebsite.update();
    context.executeQueryAsync(Onsuccess1, onfail1);
    function Onsuccess1() {
    alert("Done");
    function onfail1(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    Please help.
    Thanks,
    Sachin

    The issue is coming because the scope of context and oNewWebsite is not available in your success method. Try to modify the code as below and see if that helps.
    $(document).ready(function () {
    ExecuteOrDelayUntilScriptLoaded(createSite, "sp.js"); //This is used to ensure until sp.js is loaded, createSite will not be executed.
    var context = null;
    var oNewWebsite = null;
    function createSite() {
    context = SP.ClientContext.get_current();
    var collWeb = context.get_web().get_webs();
    var webCreationInfo = new SP.WebCreationInformation();
    webCreationInfo.set_title('TestSite');
    webCreationInfo.set_description('Description of new Web site...');
    webCreationInfo.set_language(1033);
    webCreationInfo.set_webTemplate('STS#0');
    webCreationInfo.set_url('TestSite');
    webCreationInfo.set_useSamePermissionsAsParentSite(false);
    oNewWebsite = collWeb.add(webCreationInfo);
    context.load(oNewWebsite);
    context.executeQueryAsync(Onsuccess, onfail);
    function Onsuccess() {
    dummy(context, oNewWebsite);
    function onfail(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    function dummy(context,oNewWebsite)
    var strMasterPageUrl = '/_catalogs/masterpage/Test.master';
    oNewWebsite.set_masterUrl(strMasterPageUrl);
    oNewWebsite.set_customMasterUrl(strMasterPageUrl);
    oNewWebsite.update();
    context.executeQueryAsync(Onsuccess1, onfail1);
    function Onsuccess1() {
    alert("Done");
    function onfail1(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    The other way is to use this.context and this.oNewWebsite. To see how you can modify your code have a look at the following link.
    http://msdn.microsoft.com/en-us/library/office/jj163201%28v=office.15%29.aspx
    Geetanjali Arora | My blogs |

  • [php+mysql] nextensio list: how to change row color based on field content?

    Hi all
    I have a nextensio list on a page.
    is there a way to change the background color of a whore row based on
    a specific field content?
    example I have a field containing the values 0 or 1.
    If the field content is 1 the row background color should be RED.
    ANy suggestion?
    TIA in advance.
    tony

    DataBoundAPI's you can refer to achieve this.
    Search for OLD threads also. Here are some links:
    Can we colour the rows in the column of a table
    Advanced table row font color- result based change.
    Thanks
    --Anil
    http://oracleanil.blogspot.com/

  • Page size keeps changing between pages based on browser zoom

    I recently started designing a web page for a golf league.  I designed my main page (index.html) and have it laid out all nice and neat with 9 divs (outer, wrapper, logo, social media, topnav, banner, content, rightside, footer).  My main page has horizontal navigation links near the top of the page for 7 different pages (Home, Course, Events, History, Statistics, About, Contact).  I created 6 blank html files for the other 6 pages and then created and applied the template from my main (Home) page to the other 6 pages. 
    All the pages are laid out perfectly and everything seems fine.  However, when I view the web pages and use the zoom on my mouse (CTRL + Mousewheel), it only remembers the zoom level for the current page that I'm on.  NOTE: FYI, I'm viewing all of these pages offline, which I assume might be the problem.
    For example, if I'm on my main page and zoom in, then click the "Events" link, it switches to the Events page, but doesn't have the same zoom level.  These zoom levels also seem to be saved (to my browser, not the dreamweaver code), because when I close the browser and reopen it to the web page, it remembers the previous zoom settings.
    I just started building a web page a few days ago and don't have a published web page as I haven't selected a host yet, but plan to when I know how what exactly I need in terms of size.  All the web pages I've been viewing are on my hard drive.  Is that why the zoom is not consistent across all my pages?  To clarify, if I zoom all the way in on my home page, then click "Events", the Events page won't necessarily be zoomed all the way in, it will be at the same zoom level as the last time I viewed it.
    I just want to know if this issue will go away when I actually publish my page to the internet and view it on the web?  If not, I'd like to tackle the problem now before I publish it because this site has to be professional since we're holding a big charity event in the fall with a major and well known charity and celebrity.
    Thanks in advance for any help!

    You're not using frames or framesets are you?
    In which browsers are you testing your site?
    My experience in Firefox, Chrome & IE9 is that Ctrl++ (zoom) remains constant until I change it.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com/

  • Change master pages on a button?

    Hi guys, I want to know how to be able to keep the same page, but press a button which changes the master.
    The goal is to have a menu bar (as a header) that changes to an expanded menu (a different master) Is that possible?

               Hi DEV ,
               Well , it's little tricky but pretty much doable , on click of a button ( DAY CLOSURE as per your requirement ) do the following
             1) get the current date (sysdate ) and save it in a custom table .
              2 ) save the above sysdate  in a formvalue ( itemstyle )
              3)  Next time when the page renders , again get the sysdate and value which is being saved in the formvalue
              4 ) compare the two values , if those two dates are equal then hide  webbeans programatically in processRequest of your controller
                    and display a message to the user highlighting page can't display any information for today .
              5) Hiding webbean will actually appears page to be inaccessible .
            Note : It's very difficult to make the page inaccessible , the above given solution would pretty much meet your requirement .
                 Let me know if you need any further input .
                 Regards ,
                 Keerthi

  • How to change pdf page in an iframe content automatically

    I open a pdf in my web page with <iframe> and the pdf-option for example #page=2 equals week number 2 of a year.
    How could I change the viewable page as a function of the actual week number of a year (#1 - 52)
    At the moment my html code looks like:
    <div id="tr-inside_anw2">  
        <iframe class="org_pdf_anw"
        src="attendance.pdf#page=2"></iframe>
    </div>
    Is there a way to use a variable for the week number? or is it better to use a javascript "function dayofweek_iframe()"
    which changes the whole iframe content?
    Is there somebody, who know a solution with code? Thanks

    Thanks, it worked on my Mac apps. But the problem is that the new numeration is not recognized by my PDF Reader on iPad (goodnotes), so numeration starts from 1...

  • Pages don't reflect changes in their master page

    I'm using InDesign CS5.5 (v. 7.5.3) with Mac OSX 10.8.4. I found one old question about this problem in another forum (with no submitted answer):
    Assume you have a simple document with one master which simply features a text frame. Well, now if you add some inset spacing to the text frame on the master, this is immediately reflected on the pages to which the master had been applied. However, if you edit the master again and set the inset spacing back to zero, the text frames on the pages to which the master had already been applied keep the inset spacing. If one adds new pages, the text frames have no inset spacing, as I would expect. Can someone tell me why InDesign behaves this way... i.e., why are the changes to the master not reflected on the assigned pages when I set the inset spacing back to zero.
    This question was asked re CS 2.0. The problem seems to remain in CS 5.5.

    I made the changes to the frame inset in the master pages. This is a normal setting for frames, and not complex--and in any case, the point was that I had mistakenly set an inset value, but wanted to reset it to zero, so really nothing to create as an object style. So I reset the value to zero in the master pages. No update. I tried reapplying the changed master page to the doc pages. No update.
    You note: "And if you reset the text frame in the Master it won't reflect in the pages."
    Is this a known feature/bug? Why shouldn't inset values be part of master text frames and thus updated with them? It doesn't make a lot of sense to me.
    Thanks for the suggestion about object styles, though. I don't think it applies here, but I can see the usefulness elsewhere, and I've never really looked at them.

  • How to change the master page and theme dynamically in sharepoint2013 anonymous site

    hi
    I have to change the master page and theme dynamically in sharepoint2013 anonymous site. i have to show one master page to authenticated user  another master page to anonymous user through code
    Srinivas

    Hi Srinivas,
    According to your description, my understanding is that you want to change the master page and theme dynamically based on the anonymous users or authenticated users.
    Per my knowledge, there is not an OOB way to change the master page and theme dynamically.
    SharePoint is based on Asp.net, as we know Asp.Net request processing is based on pipeline model, so we can delevlop a custom HttpModule to dynamic change the master page based on current logon user profile(using SP Object Model to get).
    Another solution could be to use the SecurityTrimmed control that injects the CSS depending on global user permissions, more information, please refer to
    it.
    Some similar posts for your reference:
    http://social.msdn.microsoft.com/Forums/office/en-US/c2b2d0da-c752-4aea-9c2d-e31a5b1a2988/sharepoint-2010-dynamic-masterpage-based-on-userprofile-property
    http://johanleino.wordpress.com/2011/10/20/using-a-different-master-page-for-authenticated-users-in-sharepoint/
    http://sharepoint.stackexchange.com/questions/21679/how-can-we-use-a-different-masterpage-for-annoymous-and-authenticated-users
    http://sivarajan.me/post/How-to-customize-the-SharePoint-2013-Master-Page-for-Anonymous-Users
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

Maybe you are looking for