Dreamweaer Extensions |
|
|||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
Random
Record
(ver 1.0.0) Basics Example Issues
|
||||||||||||||||||||||||||
| Basics: |
When you want to display a random record from a recordset each time a page is viewed, apply this SSB by selecting any of the following:
Possible uses: You may want to display a different headline phrase each time a page is viewed, or a different product image and its description or the lyrics to a different song each time the user visits your page, or ........
How to apply the behavior:
Tip 1: You may actually select more than one element on the page, for example an entire table which might contain a dynamic image of one of your products as well as several dynamic text elements for the product description, price etc.
Tip 2: It is even possible to display a random record, as in Tip 1 above, and follow this on your page with, for example, a Repeat Region using the same recordset to display many records. This would allow you to highlight one product selection at top of page, and still display many records form the recordset in the main body of the page.
Tip 3: Or it is possible to display several different random records from a recordset on one page by applying the SSB to each dynamic element individually.
| Example1: |
Using but a single recordset, this phrase was chosen randomly, while the list below was generated by a Repeat Region behavior. This shows that one can get a random record and still utilize that full recordset elsewhere on the page. Be sure to click Refresh to see the random phrase update.
In Design
View, this:

yields this:
|
lives on the learning curve
|
|
seems contemplative
|
|
appears bald to others
|
|
sports a new, graying, beard
|
|
is looking for a good doctor
|
|
hates dentists
|
|
wears size "scrawny"
|
|
has three sons
|
|
loves his sweet wife
|
|
loves babies
|
|
tolerates dogs
|
|
avoids red meat
|
| Example2: |
| Known issues : |
Dave Dimaria has discovered: "It turns out that RegExp, which is used in this extension, is a new object in VBScript 5.0, which is not the version running on my IIS 4.0 web server" and so sites designed in VBScript apparently require IIS 5+ to run. Sites designed in Javascript are unaffected.
| Unanswered questions? |
Please do not hesitate to ask for clarification of any aspect of this SSBehavior. All questions will be answered and may ultimately will appear on this page as well.
|
I am ready to help you by writing javascripts, or that specialized Dreamweaver extension you've always wanted, on a contract basis. Just email me at michael@valleywebdesigns.com.
|
[ home
| services | examples
| contact me ] |
|
for JustSo Picture Window |