Search Page using Checkboxes


(gja) #1

Hi,

 

I'm attempting to create a search page, is not really a search but the search page does what I need.

 

Unfortunately, I've struck a problem with my checkboxes.

 

The search page is nesting in an asset listing - that is listing all assets that are children of a selected asset, with a default bodycopy

<label><input type="checkbox" name="subject" value="%asset_short_name%">%asset_name%</label>

The idea is that someone can select one or more of the subjects listed - and then the search page returns the asset contents for each of the subjects selected.

 

What I've found is that when more than one is selected only the last one is returned.

Presumably it is because the querystring parameter is  http://mysite.com?subject=apple&subject=orange

 

when sqiz wants subject=apple,orange - but checkboxes don't seem to work that way.

 

Any ideas how I can make this work?

Thanks Georgina.

 


(Bart Banda) #2

That's right, the name value will need to be unique for the checkboxes. It also depends on what "subject" is actually targeting. Is it targeting a text field value or a checkbox field value against the pages? If it's just multiple values in a text field, your search query will need to look something like: ?subject=value1%20value2%value3, etc... so you add each value and separate it with a space (URL encoded). 

 

Hope that helps.


(gja) #3

The intended purpose of the search page is to provide an easy way to select assets to be included into a results page.

 

An example might be to select from a list of courses and have the results page display key information about each course selected.

 

We don't want a free form text field - rather display a discrete list of options to choose from.

 

I think a select list works - but selecting more than one option in a select list is not as user friendly as ticking some check boxes.

 

The search is a match on asset name.

 

Georgina.


(Anewport) #4

Thinking I'm understanding correctly: you are trying to send a selection of assets from one page to another, then display more asset information on the destination page?

 

If yes, try using two Asset Listings and the Asset Selections screen, see - http://manuals.matrix.squizsuite.net/asset-listing/chapters/asset-selections-screen

 

I actually asked a question about this a few years ago on the forums (http://forums.squizsuite.net/index.php?showtopic=8942) but got no answer. If this is sounding like what you want I can write a reply to that thread outlining the steps if needed.


(gja) #5

Thinking I'm understanding correctly: you are trying to send a selection of assets from one page to another, then display more asset information on the destination page?

 

If yes, try using two Asset Listings and the Asset Selections screen, see - http://manuals.matrix.squizsuite.net/asset-listing/chapters/asset-selections-screen

 

I actually asked a question about this a few years ago on the forums (http://forums.squizsuite.net/index.php?showtopic=8942) but got no answer. If this is sounding like what you want I can write a reply to that thread outlining the steps if needed.

 

This is exactly what I'm after.  I've read the asset selections screen in the manual and I think I should do the trick.

 

I've made a quick attempt, but am missing something.  I get checkboxes but no labels.

 

If you could outline steps that would be a great help.

 

Thanks Georgina.


(Anewport) #6

If you could outline steps that would be a great help.

I've added my steps and some extra notes for setting this up, see - http://forums.squizsuite.net/index.php?showtopic=8942

 

If you wanted the selections to remain during a session then it might be possible if you were to use Donation or Product assets and a Cart asset. If this doesn't work for you perhaps localStorage or session cookies may be useful but I'm not sure on how to best implement those options so maybe someone else can help out there as it would be interesting to see.

 

Hope the steps are clear enough but if not let me know and I'll clean them up where needed.