Leave feedback
  • Question

    StoryTeller Page Definition Instance

Enter a new topic
  • Dennis Staiger Dennis Staiger
    0 likes 2660 views

    How can I find out via Script on which instance of a page definition that I am currently at?

    For example, if I have two page defintions, Page 1 and Page 2 which both can have multiple occurences. On the second instance of Page 2, I need to replace a logo, for example. Can I find out whether I am at exactly this instance, and if so, modify that instance? Or would I need to have a new page template which does not have the logo etc?

    Thanks for any insight!

    Friday 03 August, 2012
  • Best Answer
    David Bares David Bares OpenText Employee Administrator StreamServe Employee

    How about a "page before" script on second page type like this:


    If you want to do it clean, you should initialize the counter in "document before" script

    $second_page_instance = 0;

    Friday 03 August, 2012
  • Dennis Staiger Dennis Staiger

    Thanks for the quick reply, David. I have used your suggestion together with a check for the current page definition name:

    initialization of $instanceCounter = 1 and $pageType = "" in document before.

    in each page before: if $pageType is different than StGetProperty('Name'), then reset the instanceCounter to 1 and $pageType = StGetProperty('Name'). Otherwise increment the counter.

    Tuesday 07 August, 2012