Jump to content

return to the initial layout


This topic is 7193 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

1) I have a very large number of layouts. The layout order list becomes particularly for the programmer too large. Is there a way to make several lists, for instance one for chapter 1, another for chapter 2 and so on..?

2) In browse modus. The reader goes very often from one layout, named A to another layout, C, which gives additional information by using a programmed button. But this additional information is also useful for a layout named for instance B. I therefore use the button: got to layout C. This is very easy. Yet once the reader is in the general information layout C, in one case, the reader wants to go back to A, in the other to B. This can be solved by to different buttons but I would find it much more elegant if I could have one button saying: go back to the last layout. Is there a way to make such a Scriptmaker?

I thank you in advance for your help.

Link to comment
Share on other sites

You will have to hide and lock the layout navigation menu, and create your own with scripts and buttons. Then, create two global fields called gNavigationHistory and gTargetField. Every time the user goes to a new layout, you can have a script append the layout number of the field that you are leaving to the contents of gNavigationHistory with a set field command like this:

Set Field[gNavigationHistory, Status(CurrentLayoutNumber) & " " & gNavigationHistory ]

Then when you want to go back to the previous layout, you can perform the following steps:

Set Field [gTargetLayout, LeftWords(gNavigationHistory,1)]

Set Field [gNavigationHistory,MiddleWords(gNavigationHistory,2,500)]

Go to Layout[gTargetLayout, by field value]

This will allow you to keep a navigation history similar to that of a web browser.

Link to comment
Share on other sites

If all you want to do is go back to the layout they came from, then you could also define a global field - "g_LastLayoutBefore_C".

Then when to click on a button to go to "C", then script is:

SetField(g_LastLayoutBefore_B, Status(CurrentLayoutNumber))

Then in "C", you only need a RETURN button which does:

GoToLayout(Layout Number From Field, g_LastLayoutBefore_C)

In this way, if you had a "Help" layout for example, then wherever the user was before they sought help, once they were finshed, they would be returned straight back to where they were.

Russ Baker

Canberra, Australia

Link to comment
Share on other sites

If all you want to do is go back to the layout they came from, then you could also define a global field - "g_LastLayoutBefore_C".

Then when to click on a button to go to "C", then script is:

SetField(g_LastLayoutBefore_B, Status(CurrentLayoutNumber))

Then in "C", you only need a RETURN button which does:

GoToLayout(Layout Number From Field, g_LastLayoutBefore_C)

In this way, if you had a "Help" layout for example, then wherever the user was before they sought help, once they were finshed, they would be returned straight back to where they were.

Russ Baker

Canberra, Australia

Link to comment
Share on other sites

Everyone jumped on question 2 -- nice one, BobWeaver! -- so I'll take a stab at question 1...

You could define a "LayoutName" field, then make a script that loops through your database and sets the layout name and number on each record.

Hint: I use "g" to designate global fields.

Set Field (gLayoutNumber, 1)

Loop

Exit Loop If (gLayoutNumber = Status (CurrentLayoutCount))

Go to Layout (by field, gLayoutNumber)

Set Field (LayoutName, Status (CurrentLayoutName))

Set Field (LayoutNumber, Status (CurrentLayoutNumber)

Set Field (gLayoutNumber, LayoutNumber + 1)

End Loop

OK, now that you've got all the layout names into a field...

Make a calculated text field, ChapterName:

Case(PatternCount (LayoutName, "Chapter 1"), "Chapter 1", PatternCount (LayoutName, "Chapter 2"), "Chapter 2", etc...)

(You might get away with something simpler like LeftWords... depends on your layout names.)

Make a global text field, gLayoutName, and make a relationship from it to LayoutName.

Format it with a value list of ChapterName.

Now you can make a "filtered" portal that shows the layouts based on gLayoutName. You might even be able to make a filtered value list...

Anyway, the last step is just a button that goes to the layout by the LayoutNumber field.

Sorry, have to go... hope this wasn't to sloppy/confusing.

Link to comment
Share on other sites

This topic is 7193 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.