How to use states site wide

Discuss techniques and workflows for ProtoShare.
AndreaF
Posts: 50
Joined: Mon Feb 23, 2009 12:28 pm

How to use states site wide

Postby AndreaF » Wed Aug 26, 2009 9:20 am

From tegloff: http://tegloff.wordpress.com/2009/08/25/protoshare-how-to-use-states-sitewide/

For those of you thinking about or using ProtoShare, I just learned a little more about states. You can implement them across the entire site. How do you do that? Use them in a template that you use throughout the site. Any change in the state will also be remembered.

Why is this useful?

Now, I can quickly mock up what screens look like based on the user’s login status. I can hide/show sections of the screen easily and hide/show login prompts. I’m hoping this will save me a lot of work. Rather than mocking up 2 different screens for each state, I can now mock up just 1: less to create and less to update as changes are made.

A note about defaults….

The first value in the state box is the default. So, if you want to default to show a certain tab open, make sure you set that state accordingly in the state setting. But, if you already have your defaults set up and then you change the order, remember that you will have to change the order for all actions that interact with that state, otherwise, they will be set to the wrong choice. This is a little cumbersome but not awful. Setting the default correctly the first time will make it easier in the future!

Debugging

One way to test your states is via the interactive mode. You can also quickly test using the “States” tab, where you can hide/show states. The “States” tab + the Widgets panel (click the “<<” button the left to open the list) really make debugging easier. Note that you can also hide/show individual Widgets from the list, without using the ”States” tab. Both areas are useful both for debugging and to access any Widgets that are not available based on the status a state.

Return to “Tips & Tricks”

Who is online

Users browsing this forum: No registered users and 2 guests

cron