-
1. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 12, 2011 11:56 AM (in response to TCarp)How are you coming on the master detail homework? The basic concept of this approach I think is fairly straightforward, but there are a lot of little details involved. When you have a handle on this you'll also want to take a look at the database structure. While it can be done using a single table, a better structure may involve maintaing lists of each of the images and and PDFs in separate tables and linking them to the main table with foreign key. Bregent is very good at this, he can look at the detail you provided and instantly visualize it where I would have to experiment a bit.
When you asked about other possible turnkey options, it made me think of Gallery2. It's an open source program that many web hosts include in their available applications and easy to install. I haven't checked it out in a while, nut I'm pretty sure it offers all the functionality you need. Just also a lot of other things you don't need. Worth checking out tho.
-
2. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 12, 2011 1:54 PM (in response to Lon Winters)Lon, thanks for checking in.
My homework on master/detail is bogged down in terminology. My impressioin is that it may be more than I want, at least to start.
As background, I have done some MS Access work, again as a hobbiest, so understand many of the RDMS concepts. I've also built one simple MySQL db with a simple PHP app (used just to generate an html "form" that users can update and submit). I successfully took the user input and updated the existing record. Nothing fancy but it gave me a beginning understanding of PHP and MySQL,
Link with any good design, I'm now making notes on what I want the user to be able to do and how I want to display the thumbnails, etc. To accomplish what I have built so far, a PHP app that reads the file records and generates the html (using tables I assume). This at least keeps me out of having to update the html directly.
I don't know if there's any advantage of keeping any of the images (thumb or others) in the MySQL db. Given the number of maps (could be in the hundreds) it may be just as easy to copy the images into an "image" folder on the site. Since the file names will be part of the map records, PHP can just insert the names at the appropriate place in the html.
This is where some advice on whether this is the best long-term approach might be useful.
I have a test site where the current method (hard coding in the html) is being used.
http://www.carpenterandassociates.com/atlas/ATL_themes.htm
I'll post back as learning and testing progresses.
Tom
-
3. Re: Advice on approach to site design for a catalog of maps
Rob Hecker2 Sep 13, 2011 9:05 AM (in response to TCarp)"I don't know if there's any advantage of keeping any of the images (thumb or others) in the MySQL db"
Don't store images in the db. It can be done (the blog data type) but it's hard on db performance and can quickly make the database too large. Store the filename only. It's easy to upload an image to the directory structure at the same time you submit to the database the data relevant to the image.
-
4. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 13, 2011 9:19 AM (in response to TCarp)You're certainly on the right track. When it comes to your output display pages, I would suggest to keep with a simple table format using repeat regions until to get a good understanding of how to create record sets and binding data from your database to the page. From there, you can use the same principles to format the page closer to what you have now.
You are correct about the images. Unlike Access, where the practice often was to include the actual image in the database, here you want to place the images in a folder location, and the database would hold the filename (thumbnail1.jpg) or possibly the path from the host page to the filename as well (images/thumbnails/thumbnail1.jpg). In the latter, watch out for path issues depending on where your host page(s) is located. Then, having a recordset on the page, you bind the image column to an image placeholder you put on the page via the insert menu. But we may be getting ahead of ourselves - the main thing to know at this point is knowing how to create the recordset (provided you have at lease one table set up with some date) and how to bind the data to the page. ( binding the data can be done in more than one way and to more than one type of element.as mentioned, it can be done with an image box, a text field or other form element, or just as text on the page.
-
5. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 13, 2011 9:26 AM (in response to Rob Hecker2)Thanks. Elimiates one of the paths.
-
6. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 13, 2011 9:48 AM (in response to Lon Winters)Data binding and record sets are terms I'm not familiar with and first web search leaves me overwhelmed.
Perhaps a better understanding of the design will set a context that will help me with the ideas.
Nobody has mentioned PHP yet. This be a novice question: am I correct that I'll be using PHP to generate the pages the user sees? Assuming the answer is "yes", is it possible using a rdb overkill? I don't know if a web page can "read" a flat file other than one that comes from a db.
What about a record that contains the file name(s) of the image(s) and those file names are merely inserted in the appropriate places in the html table via PHP? In other words, a file name like "FCUAC_Boundary_Precincts" would generate "FCUAC_Boundary_Precincts_72dpi_thumb.jpg" in the href and img statements. The record could also contain data for the title field in the href and other locations where additional info about the map is desired.
Using a field in the map record to identify things like the "group" the map belonged to (assuming a sort on the field), would allow PHP to generate "map groups".
If that's a good starting point, creating a vision for where things are headed (in user terms) would be very helpful. I normally don't do well putting tools before vision.
Tom
-
7. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 13, 2011 6:11 PM (in response to TCarp)Data binding and record sets are terms I'm not familiar with and first web search leaves me overwhelmed.
Perhaps a better understanding of the design will set a context that will help me with the ideas.
Thank you for clarifying that. It does help when tyring to explain something. In short, a recordset as defined by dreavweaver is a set of records from a data source. For example. and don't worry about the "how" part of this yet, say you have a table in ou rdatabase containing a list of people that contains theier names, addresses and so on. 10 people have last names that being with W and those are the ones you want to display on your page. The page supplied the instructions that tell it to connect to the database, the speified table tha tholds this data, and to filter it so that the result is a list of only those 10 people. That is a basic example of a recordset.
Binding is the process of taking the results, the dtata from the recordset and placing it on the page to view and/or manipulate for other purposes. These terms, as well as the how to aspect of it all, are part of the entire master/detail process.
Nobody has mentioned PHP yet. This be a novice question: am I correct that I'll be using PHP to generate the pages the user sees? Assuming the answer is "yes", is it possible using a rdb overkill? I don't know if a web page can "read" a flat file other than one that comes from a db.
PHP is most likely what you'll be using, unless you're already familiar with and more comfortable with other server models such as ASP. This means that you will also most likely be using a MySQL database as your data source. Kepp in mind that my sugesstions in these particulars are elements of the overall solution. I know that it will work, and it uses common methods and pracrices. Yet, I still woldn't mind hearing from others if there may indeed me other solutions that may or may not be easier, but may sompy be a better soltuion. Still, from what I see so far, I thnk it's your best bet.The downside is the learning curve.
As far as dynamci sites go, Master/Detail page sets are one of the most fundamental practices, and the elements that go into them are the most fundamental building blocks. So you will need a tutorial or two to get these concepts down. It may seeem like a detour from your objective, but you'll see how it ties in later. It is ossible that using a database could be considered overkill, but you will still need a data source of some kind, such as XML. But in my opinion, a boafide database ultimately is more efficient and provides easier ways to retrieve, manipulate and updtate data.
What about a record that contains the file name(s) of the image(s) and those file names are merely inserted in the appropriate places in the html table via PHP? In other words, a file name like "FCUAC_Boundary_Precincts" would generate "FCUAC_Boundary_Precincts_72dpi_thumb.jpg" in the href and img statements. The record could also contain data for the title field in the href and other locations where additional info about the map is desired.
You've pretty much just descrived how it works, regardless of where the data is coming from. Not to over-simplify things, but that's what it is - fill in the blanks. The PHP that is inserted into the markup (HTML) acts as placeholders (variables) for whatever you want to fill it in with. To be honest, I would include all the informatino related to a single entity in a single table, such as what you mwntioned above, along with the file names of the PDF's, higher rez images, etc. It would work fine. But I would remiss if I didn't point out that the database gures would opr for a relational structure, kepping say, all the 300 DPI images in theier own table and so on. I dn't disapgree, because I understand why that is better, even for simple reasons, like if you needed to change the file ame of a particular image, it's guaranteed that you will only have to do that in one place.
Teh groupd examle is a good one. You would have a table for the groups, and each map record would contain a field tha identifies the group it belongs to. That makes for very easy sorting. (But, if it's possible that one map can belong to more than one group, then it gets a bit more complex as that's a many-to-many relationship).
I titally agree that looking at the end result and identifying the objectives is the way to go. It's not unheard of to even backwards engineer an application - starting off with static content and gradually developing in the other direction. That could be time consuming and you end up running into roadblocks that you can't get past.
Anyway, do take a look at other options for data srouces such as XML or even Spry datasets, the latter of which I haven't worked with at all. As a developer, none of it is tiem wasted, even if you abandon one thing for another at some point. Again, feel free to ask any questions you have along the way, and also again, I would like to hear other opinions from others - there are so many knowledgable people on this forum, and they may be able to point you in a direction that I haven't consodiered.
-
8. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 14, 2011 6:48 AM (in response to Lon Winters)Lon
I very much appreciate the time your taking on this. I've come to the Adove forums frequently to get some hand holding and I've never been dissappointed.
Thanks for the explanation of recordset and bind. There's always a "language" to learn to communicate with those more familiar with the topic.
A year or so ago I wrote 3 simple PHP "programs". I haven't studied XML or ASP so, unless during the journey it make sense to change, I'm starting with PHP. As mentioned earlier, my first objective is to simply convert from having to manualy generate new html table cells.
The PHP I wrote before used mySQL so, although I'm doing some reading on using a simple flat file (.txt instead of MySQL), I suspect using MySQL will be my choice. It gives me options that might be useful as the design unfolds.
I'm currently refreshing my understanding by looking at my old PHP. Because I was testing and learning, the PHP was designed to delete/create the MySQL file each time I ran a test. I suspect I'll create some test "map records" and follow the same approach.
Tom -
9. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 14, 2011 9:49 AM (in response to TCarp)Sounds like a good plan. The built in DW server behaviors will take you a long way with many of the tasks you'll need to do. Having worked with mySQL in the past and that it's not a completely new thing will help. The first building block of a dynamic site is getting all this set up and includes creating the database, configuring any tables you'll foresee using and then creating the database connection in DW.
if you've not already done so, you shold set up a local testing server. I freely admit I've built dynamic sites without using a local testing server, I did all my testing on the live remote server, but just created temp pages or folders to test new pages or functions. That's not good practice, so lately I have been using a local server for development. But, only to the point where I can get it working, not to be able to explain how. To set one up or the best way to go. There are some variations, like XAMPP and WAMP and I plead ignorance on what that means. I followed a tutorial that told me where to go to download what files, what to install and where, where to place the site files and how to test in the browser. I did end up with what was needed - Apache, PHP, MySql and phpMyAdmin to manage the database. Overall tho, it really wasn't hard to set up and it felt good to be using an actual developmemt environment that mirrors the live site.
< br />For good tutorials on all these things, I would start right here -either in the Adobe site itself, or look for posts in the Forum by David Powers, Murray ACP and Nancy O - they often post links to good tutorials and shoild be easy to find.
-
10. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 14, 2011 4:45 PM (in response to Lon Winters)Again, thanks for being right there with me anticipating issues in real time.
The good news is Nancy O, et. al. helped me when I did my PHP testing/learning last year. One of the results is I have a local server installed (WAMP).
Like you, I found the install wan't too bad. And, like you, I really like having it installed. It's allowed me to do DW work without having to be connected to my sites.
Tom
-
11. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 15, 2011 9:06 AM (in response to Lon Winters)For now I'm setting up the db with 2 tables: maps and mapgroups. "Maps" has a record for each map while "mapgroups" is null for now.
What's the easiest (and most accessible) way to update the maps table? Today the table is maintained in Excel and I suspect I'll want to keep it that way (so others can maintain the map list), doing a complete replace in MySQL when changes are made.
Since I think PHP can read a flat file, I could create a txt file (from Excel), move it into a site folder, and then have PHP completely replace the existing table. Is there another way, external to PHP, to do the same thing?
Tom
[EDIT] I see some videos on how to load a csv file into mysql. That will do for testing. I'm not sure requiring someone with mysql skills is where I'm going to want to head. One longer-term alternative might be to create a php to do the copy/replace from csv to mysql.
-
12. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 15, 2011 10:39 AM (in response to TCarp)I think you've nailed down your two best options. I've found that importing a CSV file into mySQL using phpMyAdmin is not the most intuitive process, but it's not terrible difficult. If you go the other route, then it's simply a matter of replacing the file that serves as your data source. This is something I'm not familiar with, so m not sure exactly how the flat file integrates. For example, database integration is achieved via the database connection and server behaviors. Can yo use a flat file as the data source in a connection script? If so, then you'll have the best of both worlds - you'll have a working database connection which will be available to use with any of the server behaviors, if not, then you'll need to do a bit more hand-coding.
-
13. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 15, 2011 11:09 AM (in response to Lon Winters)The mysql process wasn't bad at all. There are a couple good videos on the net that lay it out pretty well. All that took time was the record/field layouts but even that wasn't too bad since I had the layouts already documented.
I may have confused you with my question on using php to do the map record update. My thinking is to just put a "refresh" button on a web page and have it invoke php that would read the csv file and completely replace the entire map mysql table. As long as a current csv file were available in a location php knew about, it should work for now. I haven't read the details of php reading a csv file but I did get some hits when I searched.
I'm now working on adding some fields to the map records that will be used by php to organize the maps on the html page. There are 9 "groups" and each of those can have a few "subgroups". An example is a "thematic" group would have subgroups like "hydrology", "recreation", etc.
I'd love to find a couple actual sites that have a similar display to get some vision for what a good, user-oriented web page might look like.
Tom
P.S. I realized I'm going to have to do mysql work on the production site eventually. Right now I'm working in the local test server.
-
14. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 15, 2011 9:21 PM (in response to TCarp)Ok, yes, I was misunderstanding. You're looking for a UI method to replace the MySQL table with an updated CSV file. Unfortunately, this is something byond my PHP coding skills. I know that it can be done, because phpMyAdmin can do it and it's a web application like any other web application that uses server side scripting. In the scenario you describe, who would be responsible for initiating this process? I've been thinking it as more of an administrative function, but perhaps there are reasons why a user may need to use a customized data file?
Other than that the first step of course would be getting the CSV file to where it belongs. This could be done simply via FTP, or the page could include a file field to select the file and upload it to a specified location using an upload script.
getting back to the "who" issue, if it is purely an administrative function, alternate solutions could include importing the CSV file via phpMyAdmin, or, create an admin section. The latter would be my preference as it provides a great deal of flexibility and is a standard feature of web applications.
I don't know if you plan on having a user login section, but if you do that could be expanded to assign access levels to registered users. Admin pages would be given a higher level of access. But even without normaal user registration, admin pages would require a login. Anyway, these pages would be the database interface to modify the MySQL table. So instead adding, deleting, editing records in the Excel/CSV file, this would be done using update pages. When including various sort and filter options, multiple editing of records, personally I think is easier to do than working with an Excel file, but that's just me. There are people very good with Excel and are efficient and fast at finding and changing things.
this would be more complex to develop if it's your first time out with such a thing, so you may want to file it and visit it later. Getting back to your idea, would an accurate description include two mainnfunction - 1, getting the new CSV file in place and 2, a script that would replace the data in a particular able with the new data, or simply replace the table?
-
15. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 15, 2011 9:25 PM (in response to Lon Winters)I just did a wick Google and found a site called phpmyedit.org.,it looks like something worth checking into!
-
16. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 16, 2011 9:51 AM (in response to Lon Winters)Got far enough to take a look at master/detail. I actually got it to generate the master and detail pages! Pretty cool!
I've also been working on the UI design and the map record fields that might be needed for master/detail. The map records have a "group" field. The 9-10 map "groups" in the actual data will be useful for the master page. (I actually looked at a tuturial the used a pulldown to allow the user to select the group thus limiting what's displayed on the master page.)
The next step is to get the DW generated php moved into the php pages that use one of my templates. Then I can use css to format the master/detail pages. I will need to do some php since the actual there a multiple formats for each map. For example, the map named "anymap" has "anymap_72dpi_thumb.jpg", "anymap_72dpi.jpg", "anymap.jpg", "anymap.pdf", and "anymap_700dpi.pdf images. This will require a bit of php too.
Been bouncing around the net but haven't found anything yet that looks like a good design for this project.
Tom
-
17. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 16, 2011 11:33 AM (in response to TCarp)Does each map belong to only one group? If not then the database has just gotten slightly more complex.
for the layout of the master page, I suggest starting with a standard table, one record per row, include the columns you want displayed and branch out from there. If you used the repeat region in the master detail exercise you know how that works, but your not limited to a single table row as a region to repeat. Also, you're not even required to use an table, you can use a div container as a region.
Also, now that you've done the linking from the master to the detail page and passing the ID variable, you're not limited to only one link from the master record. And the links are not limited to just clicks, mouse overs can be used, and they are not limited to just opening another page or image. For example, a link could trigger the image to display in a lightbox type modal window.
< br />Another layout option would place minimal info on the Master page, like a thumb, title - and place the other links on the detail page. It depends on how much detail there is, including links and whether it can all fit nicely on the master page alone. If it doesn't, the goal is to supply enough info so that if the user does have to another page, they know it's the one they want.
One method I use when there is a significant amount of detail, is to display a little additional detail on the master page using a tooltip. The master page offers a thumb, title and short description. A rollover on the thumb brings up a nicely formatted tooltip with a little more info, and finally a link to the main detail page. In fact, the tooltip itself could be another way to display all the detail and links. (I found a nice open source script that mimics the Netflix tooltip with title bar, rounded corners and drop shadow and can contain any HTML content.
-
18. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 16, 2011 12:59 PM (in response to Lon Winters)Right now each map only belongs to one group but I can envision at least two. For now, though, I'm staying with the current scheme.
My thinking is there needs to be a "portal" before the master. The user makes the group selection at the portal and the group field name is passed to the master. I can cut some php in the master to limit the group displayed to the selection.
The nice things about a portal is there's some other stuff I want users to see before any maps. There are some overall instructions and I also need them to agree to some statements about the maps (e.g. as is, subject to update, etc.).
Tom
-
19. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 18, 2011 1:59 PM (in response to Lon Winters)I needed to "see" what the user would see so I put together a simple map gallery page.
http://www.carpenterandassociates.com/atlas/ATL_counter_gallery.htm
Notice that there's a "group" selection (across the top) and, in the case of the "community" group, a "community" selection (down the right) used to jump to a section in the master.
Each "group" will organize it's maps differently and will have a different "selection" on the right.
My first thought is to cut some php so that when the user selects a group, only a subset of the master table is included (along with markup if appropriate). Depending on the group, the page would display a different right (selection and notes) column.
I have to think through how to get the right column info when the user selects the group.
I'll add some rollover to each image to bring up a brief description. Clicking on a thumb will bring up the detail table.
Haven't spent much time thinking about the "how", but at least have a visual to work with.
Tom
-
20. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 20, 2011 9:58 AM (in response to Lon Winters)Would someone look at this site and tell me how their handling the hover over the map images?
http://www.arcgis.com/home/gallery.html
I'm assuming a hover style has been set. What's drawn my attention is the image displayed on hover has hyperlinks. I'm not experienced enough to understand how that's done. Maybe its just a div with some php to select the specific information to display.
I like the hover information (although I'm not interested in rating stars) so, unless someone suggests a better way, I'd like to emulate it on my map site.
Keep in mind that the path I'm on is master/detail. I don't know if the hover with hyperlinks changes that approach.
Still headed in the right direction?
Tom
-
21. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 22, 2011 6:49 PM (in response to Lon Winters)Lon, hope I didn't lose you.
Could use some PHP help (my weakest suit).
I kinda get the master/detail php and I'll be cutting some of it (don't care about the first/previous/next/last stuff at the bottom). I can get the table formatted without too much trouble.
Because of the design, I've introduced a new variable (and table): the "group". The table consists of a record for each map group (community, thematic, base, etc.). Although I haven't actually encoded it, there's a 1:many relationship between group and maps.
First is to get the group data from the mySQL table. I'm assuming that I want to quickly loop through the selects and store the group data in an array so it can be referenced later. True?
The fields for the group table are: the group name, 3x255 character paragraphs of text, and a sequence field that the select sorts on. The sequence field helps determine the sequence for maps.
I want to filter the maps according to the selected group. For example, selecting the group "community" means the master will only display community maps.
?Can a select have more than one "filter" included?
More to come....
-
22. Re: Advice on approach to site design for a catalog of maps
TDCarp Sep 22, 2011 7:24 PM (in response to TCarp)The other thing the group data does is offer a form select button for each group. They're the buttons across the top of the sample web pabe referenced earlier.
I want the user to be able to select one of those buttons and 1) the master filters using the selected group, and 2) the hyperlinks and text in the right column change.
How do I select the 10 group records off mySQL and move them into a multidimensional array (hope I have the terminology right)?
I'm assuming the php logic once the array is built will be to get the button push, reload the master, and modify the links and text in the right col.
Is there an efficient way to do that work and then let the master take over?
Tom
-
23. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 22, 2011 8:00 PM (in response to TCarp)Hi Tom, still here - had a few glitches with the new forum software so I wasn't sure if I could still post using the iPad.
I'll have to read over your last posts and think about it. We're getting into the meat of the project that are now going to need specific solutions, not just general ones. I'll noodle a little on your last posts.
In the meantime, could yo perhaps re-describe the steps you expect the user will take while getting from point a to b to c and so on?
As far as groups go, and other filters - yes - you can filter a recordset using multiple parameters.using AND in the SWL when using an additional filter will refine the results. So if you want to return results from a certain group, yo would filter on the group name or ID, then another filter would refine the results further, such as the image size. That goes to the database setup and how the records are constructed and what fields they have. As far as that goes, how would you describe your primary database entity - a map record, something along those lines?
-
24. Re: Advice on approach to site design for a catalog of maps
TDCarp Sep 23, 2011 6:44 AM (in response to Lon Winters)This is the user experience:
After agreeing to some conditions, the user passes through to the "gallery" (the master page).
The gallery displays thumbs of those maps that belong to a selected group. On page entry, the default selected group is "community", thus community map thumbs will be displayed.
All of the available groups are displayed as select buttons across the top of the gallery page. The user can select any of the buttons and the page is refreshed with thumbs of the newly selected group. The button will also be highlighted in some way to indicate which group the page is displaying.
Depending on which group is selected, the right column (div) will display different information. In all cases, there's room in the column for text intended to provide information about the group. The text is stored in the tblgroup (the group table).
The right column may/will also differ in the navigational aids on the gallery page. For example, the community group is going to have a lot of map thumbs so a simple hyperlink into a specific community map section of the master will be available (e.g. a user from the Maple Hills community will see a Maple Hills hyperlink in the right column).
I'm not sure yet what the other map groups will have as navigation aids. If none of them have the same issue as the volume of community maps, I may need to re-think things.
Within the master, the user hovers over a thumb which displays a small version of the thumb and some information about the map. I sent a link to an ESRI page that has interesting hover display with active hyperlinks. When the user clicks on the master thumb, he/she is taken to the detail page for that particular map. That detail will include information about the map and download links for 3 or 4 different map "densities" (e.g. 700dpi) and formats (e.g. PDF).
I have an html (i.e. no php) page up to give a visual of the gallery.
http://www.carpenterandassociates.com/atlas/ATL_counter_gallery.htm
Tom
P.S. Looks like your iPad works for posts.
-
25. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 23, 2011 8:35 AM (in response to TDCarp)Yep, the new forum works better now with the iPad - I still can't use the editor, but this mode will at least recognize the return key.
I'm glad you have a group table set up, that will things easier. For the selection of Groups, I think the best way at this stage is to use hyperlinks attached to the buttons you have, text links, image buttons - anything you can make a link from. It will link to the same page and carry the group name or ID parameter with it.
Ideally though, a CSS menu would work the best, look the best and the parameter values can be dynamically populated from the groups table. It's not terribly difficult as the menu is basically an un-ordered list, styled horizontally and to other visual elements. The tricky part is getting the dynamic link values into it. At the least, I suggest to use text links, which can also be styled the same as an actual menu, and at this stage I don't see anything wrong with hard codingnthe parameters into each link.
The way it works is pretty simple - for each group button/link you append a variable/value pair to the end of the link. The variable name is of your choice, and the value for each one represents the group name or ID as stored in the main able. So the link will look something like: ATL_counter_gallery.php?GroupID=1
So each link will be exactly the same except for the value at the end.
Next, create a recordset that will retrieve all the records from the main table that belong to the selected group. The standard recordset server behavior in simple mode will work. After selecting the connection and table, select/enter the 4 filter options below. Select the column from the table that contains the group ID or name, equals to, URL parameter, then enter GroupID in the text box. (or whatever name you gave the variable in the link). Transfer over to advanced mode and edit the column parameter to set the default value for the group ID that should initially display.
Save that recordset and make a new one, using the same parameter filer, but this time use the groups table. So with those record sets you can bind data from the first for the main content, and the sidebar from the second.
This will work, but actually only one recordset is required - one that joins the two tables based on the Primary key from the groups table. This will be the groupID and is what should be in the main table to match each map record to is group. In fact, the repeat region server behavior won't work properly if you have bound data from two recordsets in the same region, so in that case a single recordset is required.The SQL contains a JOIN statement and is not complicated, but I'm not one who can type it from memory - the advanced recordset tools are supposed to help with writing the SQL, but I've used other methods when needing more advanced statements.
Hopefully this will get you started building the master page if you haven't already done so.
-
26. Re: Advice on approach to site design for a catalog of maps
TDCarp Sep 23, 2011 9:11 AM (in response to Lon Winters)Funny you should mention a css approach for the group buttons. When I first "drew" the visual of the master/gallery, the thought of making them a nav div occurred to me. Since there was plenty else to learn, and I have some php code that responds to the button push, I decided to leave them as form select buttons for now.
Ideally though, a CSS menu would work the best, look the best and the parameter values can be dynamically populated from the groups table. It's not terribly difficult as the menu is basically an un-ordered list, styled horizontally and to other visual elements. The tricky part is getting the dynamic link values into it. At the least, I suggest to use text links, which can also be styled the same as an actual menu, and at this stage I don't see anything wrong with hard codingnthe parameters into each link.
The way it works is pretty simple - for each group button/link you append a variable/value pair to the end of the link. The variable name is of your choice, and the value for each one represents the group name or ID as stored in the main able. So the link will look something like: ATL_counter_gallery.php?GroupID=1
I've started some coding on the master page to select the group table with some logic that determines whether to use the default group or respond to a button push. The group table has a sequence field set up in a way that the very first record will be the first group (the select ORDERs by this field). The result is a variable ($selectGroup) that contains the groupID (default or selected). From here I can generate html that highlights the selected group button and use the variable as the WHERE filter for selecting map records.
Since the group records have the right column text it's pretty straight forward to generate the html (<p>) records. There's some logic to be built for how the right column links into the master page are generated. The map records have fields that will be used to generate those links.
My first goal is to echo the group records to make sure I'm retrieving them properly. From there I'll apply the formatting to the selection buttons (either form or ul) and generate the right col text.
PHP is my weak spot so I'm doing a lot of web searches for explanation of the commands as I study the master/detail generated PHP.
Tom
-
27. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 23, 2011 10:19 AM (in response to TDCarp)Are you using the Recordset server behavior or are you hand coding all this? If it's the latter and if I'm missing something, it sounds like you're creating extra work for yourself, at least with the filtering for groups.
I get the feeling I'm missing something, either in what you want to grab from the database or what you want to actually display on the page. But if it is as it sounds - click the group button and only the information for the maps that belong to that group get displayed (in whatever layout), the recordset behavior will filter the dsta and set the default group with only a few clicks.
-
28. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 24, 2011 11:02 AM (in response to Lon Winters)It's undoubtedly my limited understanding of the capabilities of DW and PHP that is causing any confusion you may be experiencing. As a hobbiest, my use of DW is pretty "brute force" so its very possible I'm making more work for myself.
Recordset is not something I'm familiar with so will do some reading later today.
You're doing exactly what I need. Now that I have a design outcome (user experience), the next step is how to best create it. That's where the PHP coding becomes relevant: something I'll take all the help on that I can get.
Let's start with the code I'm working on now. As you noted, I want the group selection button to display only those maps that belong to that group to be displayed on the master page.
I'm using the master that was generated by DW. Although I don't fully understand the PHP that was generated, I do understand it well enough to know where to make the table changes (formatting, info displayed, etc.) when I get around to it.
What I'm adding is code early in the php page to deal with the group buttons and the user act of selecting one of them. Here's the logic and approach:
I'm assuming
if (!$_POST)
will allow me to either act on the user button selection or, 1st time through, select the group records from the db and set the initial group default.
Remember, I'm using a form for the buttons. You're comment earlier about using a ul might change my approach completely.
First time through, all the group records (not the map records) get selected:
mysql_select_db($database_maps, $groups);
$query_groups = "SELECT * FROM tblgroups ORDER BY DispSeq ASC";
If I understand the PHP/MySQL right, the result is $query_groups will contain all 10 of the group records.
The DispSeq field in the group records will sort in a way that the first group record contains the default MapGroupID.
I think I can extract that default by:
$selectGroup = $query_groups($MapGroupID);
I can loop through the group records via:
while ($row = mysql_fetch_array($query_groups));
which allows me to set of the variables used in the form to display the buttons.
If it's not the first time through, I can set $selectGroup via the post and skip setting the botton variables since the order of the buttons in the form won't change.
Somehow I'll translate the $selectGroup into a "class" entry in the form to allow css to highlight the selected button.
The $selectGroup will then be used in the map selection for the page via the WHERE clause in the map select statement used in the master page logic.
Is this sound or is there a better approach?
Tom
-
29. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 29, 2011 3:08 PM (in response to TCarp)Whther you're using a Form (POST) or URL (GET) parameter, the mechanism is the same - your passing a variable-value pair that tells the master page how to filter the main maps table and what records that will ultimately be displayed.
The Recordset server behavior is valuable in this process because it automatically connects to the database and table, retrieves the fileteringparameters that is sent to it and produces the desired output. This output is displayed on the page by using the Bindings panel - where you simply drag the table column to the desired location on the page within a region. Then, by adding a repeat region server behavior, this automatically loops through the records and dynamically duplicates the initial region, nut populates it with data from each individual record that is part of the initial filtered recordset.
Going back to the form where your group selection buttons are contained, are you using a single form with several submit buttons, or are you using a separate form for each button? Either way, this could present some challenging coding. Take for example, a less complicated set up. You have a single form, and drop down box that contains the group IDs and a submit button. The instance name of the drop down will be the variable name, and the selected item in the list will be the value. The form action directs to the master page, where a recordset behavior is waiting to look for that variable, and use the value to filter the table results.
So now it depends on how you have that part of the page set up and configured. When a button is clicked, two things must take place - the page must redirect to the master page, and the variable- value pair must be sent along with it. The destination page is the same. Variable name must be the same. The only thing that changes is that variables value, dependent on which button is clicked.
-
30. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 30, 2011 8:28 AM (in response to Lon Winters)I have to admit I'm having a problem understanding (not your fault; limits in my understanding of the terminology and approach you are talking about). Your posts are guiding my learning. Obviously there's an important topic here.
My buttons are a single form with multiple submits. The buttons are spread horizonatally across the page. The order of the buttons is determined by the order of the group records (i.e. I can loop through generating the form's submits as I read the group records). The only trick is to add a class to the submit when I encounter the one that is either the default (1st time on the page) or the one selected by the user so it can be highlighted on the page (via css).
My testing has been focused on the "if (!$_POST)" to determine whether to use the default group or the one the user has selected. Seems to be working. The next step is to add the code to generate the buttons and the class.
I'm plowing through the code generated by the master/detail php DW generated to understand what it's doing.
I'll post again when I get a bit further.
Tom
-
31. Re: Advice on approach to site design for a catalog of maps
Lon Winters Sep 30, 2011 12:16 PM (in response to TCarp)I think I have the basic grasp of what you're doing with the form and submit buttons. It sounds like you are using dynamic data from the groups table to help generate the buttons and their respective GroupID values. I don't see anything inherently wron with the approach as long as you can get it to do what is required.
If you do look into the recordset bapehavior, you'll see that you can set a default value, which can be any or all of the groups. Using this, you can eliminate at least one of the aspects of what the button bar is supposed to do. In other words, when the page first loads and before any of the group buttons are clicked, you can have the default group display.
-
32. Re: Advice on approach to site design for a catalog of maps
TCarp Sep 30, 2011 7:04 PM (in response to Lon Winters)I think I may be using recordset without understanding it. I'm still going to use the master/detail. When I set it up, it brings up a recordset window to fill in and I see the recordset name is used in the generated php. That's the extent of my understanding for now.
Is recordset a DW feature? Or is it mySQL?
Other than formatting the tables generated by master/detail, the only change I'm planning on making to the master page is the group work prior to executing the master and a minor change to the SELECT based on the result. In other words, in the group logic (other than generating the form selects) I'll get the default or the user-selected group and then use that as a WHERE in the select in the master. This will filter the records on the master to the group selected which is what I want.
After that it's just a matter of formatting including a hover over for the individual master records.
There's something important about recordsets you're trying to get across. Just haven't had the "ah ha" yet.
Tom
-
33. Re: Advice on approach to site design for a catalog of maps
Lon Winters Oct 1, 2011 11:11 AM (in response to TCarp)What do you have listed in your server behaviors panel as far as user created behaviors? If you did create a recordset along the way it will show up here under its name.
A recordset in general terms is simply the PHP code that contains the SQL statement to retrieve certain data from the MySQL database. In DW terms, it is a built in server behavior that provides a visual interface that you configure by choosing the table andnfiltering parameters, and it generates the actual code. The dialog has both a simple mode and advanced mode. Use the simple mode if you just want to select all records from a table, or filter it using only one parameter. Use the advanced mode if you need to filter using more than one parameter, write more complex SQL statements, or change the default value of a parameter.
So if you do have a master page that is showing data, you probably do have the DW recordset in there somewhere
-
34. Re: Advice on approach to site design for a catalog of maps
TCarp Oct 2, 2011 8:51 AM (in response to Lon Winters)The server behavior panel has the recordset that was created when generating the master/detail.
From what you're saying, it sounds like DW will generate SQL code to create a recordset or a query to it. In other words, instead of having to write the SQL statements from scratch, DW can generate them. It looks like the "+" in the recordset and binding panel tabs is how you trigger the creation of the new code. Am I getting it?
I'm reminded of how little I actually know about DW. When I first started building hobby sites, I spent a great deal of time getting to understand the html and css, and today I still tend to do much of my work there. Probably the habit (along with being self-taught) that has led to underutilizing DW capabilities.
As I mentioned earlier, I intend to use the master/detail generated by DW so the code will be fine other than table formatting, some hover logic, and the need to modify the select statement with a WHERE clause coming from the "group" default or user selection. I'll use the server behavior panel to generate the SQL for the group recordset and study what DW actually generates.
Thanks for being patient. I'll probably need some help figuring out the SQL One example is a chunk of code that defines a function called GetSQLValueString which appears to be used as needed to make sure strings don't contain characters that could cause problems. I don't see that function being called in the master but it is called once on the detail page.
The next chunk of code in the master appears to do the map record retrieval and sets things up for the previous/next buttons after the table. I'm working my way through that code a line-at-a-time to understand what's going on.
-
35. Re: Advice on approach to site design for a catalog of maps
Lon Winters Oct 2, 2011 10:14 AM (in response to TCarp)Yep, you're spot on about the recordset. I could have saved us some time had I remembered that the Master/Detail thing automatically sets up the server behaviors needed. You probably also have a Repeat Region behavior showing up in the same list, correct? And there is the recordset navigation that has been added where you can specify how many records to display per page.
Let's take a look at the current SQL. Double click the recordset in the server behaviors panel to open the dialog.it will eith open to the Simple or Advanced mode, the latter will show the actual SQL statement. If you would copy that and paste it here. You're correct, you will need a WHERE clause to filter by group, and that cab be added in Simple mode. I think it's a good idea to add the first where clause in simple mode, then switch to advanced mode so you can see how DW handles the parameters in the where clause.
-
36. Re: Advice on approach to site design for a catalog of maps
TCarp Oct 3, 2011 7:16 AM (in response to Lon Winters)Yup, there is a Repeat Region in the panel. Also, DW says the SQL is too complex to be viewed as Simple.
You posted earlier about an alternative to the use of form buttons for the "group" selections. As I study the master/detail code I think I've run into examples of what you were talking about. For both the links to the detail and for the first/previous/next/last section on the master, DW generates anchored hrefs. They use what I've come to learn is a "query string" appended to the URL (i.e. ?string).
I think I understand the links to the detail page. What I don't understand is the first/last section. This is the generated html:
<td> <a href="/CarpenterAndAssociates/atlas/ATL_counter_gen_master.php?pageNum_maps=0&totalRows_maps=113">First</a>
</td>
It looks like its passing two values: pageNum_maps=0 and totalRows_maps=113. When I go to the top of the php to find, what I assume, will be a GET with two values I see:
if (isset($_GET['pageNum_maps'])) {
$pageNum_maps = $_GET['pageNum_maps'];
and later:
if (isset($_GET['totalRows_maps'])) {
$totalRows_maps = $_GET['totalRows_maps'];
Am I correct in understand these two GETs are "getting" the query strings passed by the href?
If I'm getting it, I now see how I could use the technique you mentioned (instead of buttons in a form, use a ul with li's that have an anchored href). From what I've read, FORMs actually generate a url?query string. Is there any reason to select one approach over the other?
Although there's quite a bit of the php and sql code generated in the master/detail that I still don't understand, I get it enough to see what's going on and enough to know where to insert the "group" record logic.
-
37. Re: Advice on approach to site design for a catalog of maps
TCarp Oct 3, 2011 9:39 AM (in response to Lon Winters)I do have an additional question on how GET will differentiate input from the first/prev/next/last post and the one that comes from the "group" selection.
It may not matter that there are two different sources of GET data as long as the "id" from the group selection is different from those used in first/last.
Is that how GET works? Does it not care whether the data came from one section of the html or another as long as the "name" used for the variable being passed is unique?
-
38. Re: Advice on approach to site design for a catalog of maps
Lon Winters Oct 3, 2011 10:37 AM (in response to TCarp)Correct. They are two different uses of the query string, or URL parameters. One would be to pass the group ID to the recordset, and the other is what you see in the code for recordset paging.
The code used for paging is a bit complex and there's a lot of it. There's a question of whether you actually need it, and that depends on how many records you will need to display on the master page - the group that contains the most records. And then it depends on how many records you want to display at once and reduce the amount of user scrolling if it's a long list.
-
39. Re: Advice on approach to site design for a catalog of maps
TCarp Oct 3, 2011 11:25 AM (in response to Lon Winters)I had the same thought about the paging. I've decided, for now, to leave it in since I don't yet know how many master records will be displayed. I suspect it won't be needed so, once I know for sure, I'll pull it out.



