close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic Menu linking to DataAssist results page

Thread began 2/12/2010 8:32 am by Russell Collins | Last modified 2/16/2010 6:38 pm by Eric Mittman | 1479 views | 12 replies |

Russell CollinsBeta Tester

Dynamic Menu linking to DataAssist results page

Hi,
I have been going over the tutorial for building dynamic menus in MenuWriter.
I'm seriously confused.

The tutorial only references to a DA Details page, not a results page.

Here is my situation,

I have a products table, a category table, a lookup table (prod/cat) and an artists table with an artist id in the products table.

I want to achieve the following results

A dynamic menu selecting the categories (level 1) followed by a list of possible artists (Level 2) to then show in a DA results page (as thumbs) so they can be selected to show the details page of the product.

Any clues ?

I have searched the forum high & low and have not found anything.

I just cant seem to get any search results in a results page.
I have got the categories and artists to show as dynamic lists but that as far as I can get.
I'm falling down on the linking the DA page

Regards

Russell

Sign in to reply to this post

Eric Mittman

You should make sure to get your DA results page working correctly first, then you can just update your menu to pass the rite value to this page to see the intended results.

For the results page you will need to define a search criteria based on the results you would like to see. So if you have a recordset that is selecting all of the items for an artists you would add in a search to the DataAssist search server behavior that would look at the artists id column and match it to a get variable for the id. It might be like this:

separator: AND
column: artists_id
type: number
comparison: =
value: <?php echo isset($_GET['artistsID'])?$_GET['artistsID']:"" ?>

You could test the page out by visiting it with the artistsID= and use a valid artists id number. You should see the items for that artists.

Once that part is worked out you would then craft your menu so that the links to the results page contained this artists id like this:

results.php?artistsID=<your artists id number>

Please post back with any additional questions that you have or if you run into any problems.

Sign in to reply to this post

Russell CollinsBeta Tester

Filtering

Thanks very much Eric,

I have a much better understanding.

So, normally in step 5 of the DA wizard (search page options) I would setup up a menu for selecting each search field such as artistID, CategoryID and a check box to to view products off or online (viewable for the public), would I still do that, or leave each as the default text field and let Menuwriter place search criteria into them?

Regards

Russ

Sign in to reply to this post

Eric Mittman

If I understand the situation correctly I think that you will want to still do it this way, but after you do that you can edit the DataAssist Search server behavior to ensure that it is configured to work with the links you craft in Menu Writer.

One of the things to think about is making sure that the search form is set to method="get" so that you can use URL parameters in place of form values to get the same results.

Sign in to reply to this post

Russell CollinsBeta Tester

Search page

Eric, do I need a DA search page or could I just place a search behaviour in a results page

Russ

Sign in to reply to this post

Russell CollinsBeta Tester

sending 2 url parameters

Eric,

I have managed to get the menu dynamically driven and the search behaviour as you indicated.
Here is a line of the artist search
<?php echo ((isset($_GET["S_ARTIST_idARTIST"]))?$_GET"S_ARTIST_idARTIST"]:""); ?>

Here is the line for the cat search
<?php echo ((isset($_GET["S_idCATEGORY"]))?$_GET["S_idCATEGORY"]:""); ?>

How do I send 2 url parameters in the link window to the results page?
I have the following in the there

/products_Results.php?ARTIST_idARTIST=[ARTIST_idARTIST]

The results is a blank page with this at the top

products_Results.php?ARTIST_idARTIST=1

Regards

Russell

Sign in to reply to this post

anonymous

Hey Russell,

You should be able to accomplish it with using the "&" sign like this:


/products_Results.php?ARTIST_idARTIST=[ARTIST_idARTIST]&OtherVar=OtherValue

Regards,

Brian

Sign in to reply to this post

Russell CollinsBeta Tester

Thanks

Thanks for that, now all I have to work out why my results page continues to be blank !

Russ

Sign in to reply to this post

anonymous

Perhaps a value is not getting passed like you think it is.

You could try to echo your URL vars on the page to see what happens.

If you post the code, I will also take a look and let you know if I see anything.

Regards,

Brian

Sign in to reply to this post

Russell CollinsBeta Tester

Here is the search on the results page

<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAproducts;
//Searchpage: products_Search.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_POST["Search_x"]) && $_POST["Search_x"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations

//comparison list additions
$WADbSearch1->addComparison("ARTIST_idARTIST","".((isset($_POST["S_ARTIST_idARTIST"]))?$_POST["S_ARTIST_idARTIST"]:"") ."","AND","=",1);
$WADbSearch1->addComparison("idCATEGORY","".((isset($_POST["S_idCATEGORY"]))?$_POST["S_idCATEGORY"]:"") ."","AND","=",1);

//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_products_Results"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_products_Results"]) && $_SESSION["WADbSearch1_products_Results"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_products_Results"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...