I created a similar search using tvExplorer to what you want although mine isn’t connected to a user profile so I don’t know how you make TV’s editable via a profile page. I can’t show you a demo because the site isn’t live yet but I’ll try to explain how I did it. I’m assuming you have tvExplorer installed correctly.
The site is a database of brands. Each brand has it’s own document with various bits of company information stored in TV’s, some of which are searchable. The attached image shows what the final search form looks like.
As you can see, the search has five parameters, each filtering a different TV or document variable. So the first step is to create the TV’s for each parameter and assign them to the appropriate template, in this case the template for my brand documents. The TV values need to be populated for each brand document.
The relation between form fields and TV’s is like this:
Brand - searches the document [*pagetitle*] variable.
Sector - searches a custom TV [*sector*] using the Listbox (Multi-Select) input type.
Products/services - searches a custom TV [*products-services*] using the Text input type.
Owner - searches a custom TV [*owner*] using the Text input type.
Country HQ - searches a custom TV [*countryHQ*] using the DropDown List Menu input type.
To create the seach form, I placed the tvExplorer call in a chunk {{brandSearchBuilder}} because the form appears on multiple page but you could put it straight into a template.
{{brandSearchBuilder}}
[[tvExplorer? &tveID=`bs` &dittoName=`Ditto` &dittoSnippetParameters=`tpl:brandResultsTpl|parents:9|depth:2|display:all|sortBy:pagetitle|sortDir:ASC` &formTPL=`brandSearchTpl`]]
[+bs_tve.searchForm+]
&tveID=`bs` - I used an ID for the call because I have more than one tvExplorer form on each page but you don’t need this if you only have one. If you don’t use the ID parameter, you don’t need to add bs_ to the placeholders.
&dittoSnippetParameters=`tpl:brandResultsTpl|parents:9|depth:2|display:all|sortBy:pagetitle|sortDir:ASC` - these are just the standard Ditto parameters but in the format parameter:value|parameter:value. The equivalent Ditto call would be [[Ditto? &tpl=`brandResultsTpl` &parents=`9` &depth=`2` &display=`all` &sortBy=`pagetitle` &sortDir=`ASC`]]
&formTPL=`brandSearchTpl` - this is the template chunk containing the actual form.
[+bs_tve.searchForm+] - the placeholder for the &formTPL chunk. This would be [+tve.searchForm+] if you didn’t use the &tveID parameter.
The template chunks are as follows:
tpl:brandResultsTpl - the Ditto chunk for the search results (whatever you want the results to look like)
<h4><a href="[~[+id+]~]">[+title+]</a></h4>
&formTPL=`brandSearchTpl` - the search form template
<form id="bs-form" action="your-landing-page" method="get" >
<fieldset id="bs-fieldset">
[+tve.keywordsSearch:excludeTVs->all:label->Brand+]<br />
[+tve.sector:filter->9:label->Sector:tvtype->select:blankLabel->- Please choose -+]<br />
[+tve.products-services:fullText->true:filter->7:includeTVs->products-services:label->Products/services+]<br />
[+tve.owner:fullText->true:filter->7:includeTVs->owner:label->Owner+]<br />
[+tve.countryHQ:filter->9:label->Country HQ:blankLabel->- Please choose -+]<br />
</fieldset>
<fieldset id="bs-buttons">
<button type="submit" id="bs-button" name="bs_search" value="search">Search</button>
</fieldset>
</form>
Each placeholder is replaced by a form field of the type specified, searching the variable specified and with any other parameters specified. Parameters are separated by a colon. See the docs for info on tvExplorer filters.
[+tve.keywordsSearch:excludeTVs->all:label->Brand+]
- uses text field element searching each entire brand document: exclude all TV’s from the seach (so just searches the document variables): attach the label Brand to the form field.
[+tve.sector:filter->9:label->Sector:tvtype->select:blankLabel->- Please choose -+]
- only search the [*sector*] TV: use filter type 9: attach the label Sector: use the select box form element: use the label Please choose - as the first option in the select box.
[+tve.products-services:fullText->true:filter->7:includeTVs->products-services:label->Products/services+]
- only search the [*products-services*] TV: use fulltext search (made the search case insensitive for me): use filter 7: include the [*products-services*] TV (not sure why that is needed!!): attach label Products/services
The other placeholders work in the same way.
The final step is to create the search results page. I created a separate document for the results and in the content area added the placeholder
[+bs_tve.dittoList+]. This would be [+tve.dittoList+] if you didn’t use the &tveID parameter. This placeholder gets replaced by the Ditto output.