re "lists" ?

I would like to make a page for my kids school that is searchable and the output is a list - this is for all the teachers in the school - it would have first, last name, grade, specialty, picture, background, email, etc.

I would also like to have list showing each grade level, specialty, i.e. math

any suggestions for integration with Freeway

thanks

Scott


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There’s two basic ways to do this, one would be with a database on your server, and the other would be using JavaScript. Which one you choose has more to do with the list and its administration than anything else. If you are going to be modifying this list all the time, then I would use a database. Particularly if you are not the only one maintaining it. But if it’s a fairly static list, you could use a JavaScript function to filter the list, and only show matches. You can see an example of the latter here:

http://files.libertyfund.org/pll/pages/subjects.html

The script that does the trick is visible if you view source.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

the list would definitely be pretty static, but I have no idea how to do what have done,using a database seems a little more straight forward, but how do I integrate that with Freeway and create the various layouts


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The example page is a simple unordered list, styled to look like something else. Type in a list of names, then highlight all of them and at the bottom of the Inspector, there will be a segment called List. If you open that up and press the right - arrow, you will get a list.

To make the filter work, you’ll need to install the Protaculous Action in Freeway and apply it to the page, and once you do that, you can copy and paste the following into the Actions palette.

document.observe("dom:loaded", function() {
	var list = $$("#listAll li");
	var lastValue = $F("filter");
	$('filter').observe('keyup', function(e) {
		var value = this.value;
		if (value !== lastValue) {
			value = value.toLowerCase();
			list.each(function(el) {
				if (el.innerHTML.stripTags().toLowerCase().include(value)) {
					Element.show(el);
				}else{
					Element.hide(el);
				}
			})
			lastValue = value;
		}
	});
});

Somewhere on the page, add a text field, and name it ‘filter’. Publish, and type in the box, you should see the list shrink and only show the matches.

This basic idea can be stretched to fit a surprising range of layouts, so I wouldn’t give up on it before you try it. There’s no reason why you have to use an unordered list other than it’s very simple to lay out. You could draw a large HTML box, then fill it with inline HTML boxes, one per person. Type each person’s details in there, and then you would change the first line of the function to be:

var list = $$("#yourBigBox div");

And that would magically select all HTML boxes that were children of your large “parent” box and perform the same magic trick on them.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter - you have always been so patient and informative, I have failed - I put some names in an html box, made a list

and then inserted a form field called “filter” published it but the names just appear in the html box as is and nothing happens when I type in a name to be filtered because the names already appear in the html box, what type of “fields” on the layout do I use


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, the way I set up this page, everything is showing and then you
filter down to what you want. If you wanted the page to be empty when
you first see it, and then fill in with the matches as you type, you
could also do that.

First, after making your filter, you do also have to insert that blob
of JavaScript into your page, and you have to name your container HTML
box ‘listAll’ – sorry, I left that detail out.

But then if you wanted to make the page appear empty and then fill in
with the matches to the “search”, you could add this line in the
JavaScript, right after var list = ...

list.invoke('hide');

That will cause the entire list to disappear before the page loads,
and then when you start typing in the filter box, you will get close
to your search effect. As the letters match, the list will fill in,
then shrink until only the matches show. Because any letter that gets
typed is bound to match a significant number of names, you may find
that this doesn’t really look like a search. The script is really
ideal for filtering down rather than building up to a match.

Example freeway doc here: <http://scripty.walterdavisstudio.com/filter-list.freeway.zip

(You will need a current version of Protaculous.fwactionb from
ActionsForge in order to run this document.)

Walter

On Dec 5, 2008, at 1:23 AM, ScottSimons wrote:

Walter - you have always been so patient and informative, I have
failed - I put some names in an html box, made a list

and then inserted a form field called “filter” published it but the
names just appear in the html box as is and nothing happens when I
type in a name to be filtered because the names already appear in
the html box, what type of “fields” on the layout do I use


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter

Interesting this

On your example file - the yellow box that says “hide everything first” with the Observer action attached.

I assume that you were planning on adding code in the Function Body of one of the events to invoke this

I did use the code with the extra list.invoke line and it worked but I assume that there is probably a much shorter bit of code (hide this div) that would do the same thing.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You can’t hide the DIV, you have to hide all its children, one at a time, otherwise you can’t unhide them one at a time. I put the Observer in there just to show what it would look like. If you follow my example above, then the same thing would run before the page ever loaded.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options