NOTE : this post has been translated with google translator
Hi,
The file containing the snippet is here. :
http://modxcms.com/forums/index.php/topic,16455.msg104821/topicseen.html#msg104821
Before using tvExplorer you have to install tvEditor Module
What is tvExplorer?
tvExplorer offers you to create very easily advanced search forms combining fulltext, document tree and tvs.
The list of results is generated with ditto.
Sample form using tvExplorer:
http://www.deco-in.com/recherche-avancee
DOCUMENTATION
Obligatory parameters:
&dittoName => the name of the snippet ditto to be used
&dittoSnippetParameters => parameters of ditto
They must be written in the form
param: value|param: value
&formTPL => name of the chunk containing tvexplorer tags
IMPORTANT:
To activate tvexplorer you must give to your submit the value “search”.
If you use the parameter &tveID, think of adding like prefixes the value of &tveID followed “_” to the value “search”
Ex: &tveID= `tvx `=><input type="submit" name="tvx_search" />.
Optional parameters:
&tveID => for multiple calls of the snippet in the page, this parameter makes single each form.
You will have to add this value like prefix followed by “_” in front of each placeholder placed following the call.
Ex: &tveID= `tvx `
[+tvx_tve.searchForm+]
[+tvx_tve.dittoList+]
&extraTVs => If in your/your chunks Ditto you use the placeholder [+tagLinks+], extraTVs enables you to post tvs which do not form part of the form.
They will have passed to ditto via tagData.
&cssStyle => list of files css (separated by a comma) to include in the head document.
&jScript => list of files js (separated by a comma) to include in the head document.
Tags
Syntax to use to build a tag is as follows.
[+tve.nomElement:param->value:param2->value2+]
Tags for the tvs
- Properties of the tags tvs
- tvtype: which type to apply to the for frent end rendering
- fullText: activate full text search on this tv
- filter: which filter to apply
- filterOff:
- label:
- The method #RANGE
here is a sample using the range Method
The form element before applying the range method
once the range is applied
Some explanations
The tv type in DB is number
[+tve.ObjectPrix:#RANGE{tvtype->dropdown:label->Votre budget (prix max.):elements->@Chunk intervalPrix:filter->4}+]
tvtype->dropdown => we are changing the tv type from number to dropdwon
elements->@CHUNK intervalPrix => as tv type in db is number there are no options so we’re creating them by calling @Bindings (all are supported @EVAL @SELECT @DIRECTORY plus one I creatd @TV)
In this sample the chunk contains
Moins de 15€==15||Moins de 50€==50||Moins de 80€==80||Pas de limite==9999
filter->4 the filter to apply
If you need to have two elements in your range you have to separate the properties with ||
[+tve.tvname:#RANGE{from || to }+]
Special tags
[+tve.keywordsSearch+]
- Properties of keywordsSearch
- searchStyle
- label
- excludeTVs
- includeTVs
to supplement
[+tve.parentElt+]
parentElt is used to restore the tree of documents in the form of its choice to offer to the visitors faculty to restrict research with a folder and its children in particular.
Ex of tag:
[+tve.parentElt: type->select: start->10,15: depth->2,3: label->Choisissez a heading: blankLabel->-+]
-
parentElt Parameters
- start: list ids of the folders which you wish to post separated by a comma.
Ex: start->5 or start->5,14,47
- depth: fix the depth for each folder contained in the list start.
You can define a depth for each folder
Ex: start->5,14,47: depth->2,3,1
- excludeStart:
- hideFolders:
- type: the type of element has to use in the form (checkbox, dropdown/select, radio/option)
The denomination modx and HTML are supported
- label: The text contained in the beacon <label>
Ex: label->Mots Key
- blankLabel: for the selects/dropdown you can determine the text to post in the first empty value.
blankLabel->sélectionnez a value
- addBlank: If you wish to activate/decontaminate the first value select empties (by defect the value is 1)
Ex: addBlank->0 one decontaminates the inclusion of the first option empties select.
[+tve.dateElt+]
Ex of tag:
[+tve.dateElt:source->createdon:name->dateCreation:filter->dateFilter: label->Créé le+]
* source
* name
* dateFormat
* dateSplitter
* filter
The system of templates
- Chunks by type
At the time of the installation of the module tvEditor, chunks by defect will be installed for tvExplorer.
Here contents of each one of them.
I will standardize their contents for next the release.
The construction of each input is carried out by using the class MakeForm de Jason (OpenGeek)
I will return later on the régles of substitution of the placeholders of the MakeForm class.
to supplement
&checkboxTPL
<label class= " checkbox " [+for+] ><input class= " checkbox " type= " checkbox " [+id+] name= " [+name+] “[+value+] [+size+] [+checked+] [+disabled+] [+style+] [+events+]/> [+label+] </label>
[+extra+]
&textTPL
<label class= " [+required+] [+optional+] [+className+] “[+for+] > [+label+] </label>
<input type= " text " [+id+] name= " [+name+] “[+value+] [+size+] [+maxlength+] [+readonly+] [+disabled+] [+class+] [+style+] [+events+] [+onclick+]/>
[+extra+]
&hiddenTPL
<input type= " [+type+] “[+id+] name=” [+name+]” [+value+]/> [+extra+]
&selectTPL
<label class= " select [+required+] [+optional+] [+className+] “[+for+] > [+label+] </label>
<select [+id+] name= " [+name+] “[+size+] [+disabled+] [+multiple+] [+class+] [+style+] [+onchange+] >
[+tve.wrapper+]
</select>
[+extra+]
&optionTPL
<option [+value+] [+selected+] > [+label+] </option>
&radioTPL
note: this one will have to be modified in the new version of tvexplorer (<label> badly placed)
<input class= " radio " type= " radio " [+id+] name= " [+name+] “[+value+] [+size+] [+checked+] [+disabled+] [+style+] [+events+]/>
<label radio class= " [+required+] [+optional+] “[+for+] > [+label+] </label>
[+extra+]
- Personalized chunks
to supplement
Placeholders
- To place after the call
to supplement
[+tve.searchForm+]
[+tve.dittoList+]
- To place in the chunks
to supplement
EXAMPLES:
http://www.dixsix.fr/explorer/
The code of the chunk &formTPL
<form action= " [~[*id*]~] “method= "get” >
<fieldset>
[+tve.keywordsSearch:excludeTVs->all:label->Mots clés+]
</fieldset>
<fieldset>
[+tve.Name:filter->9+]
</fieldset>
<fieldset>
[+tve.categorie:filter->9:blankLabel->-+]
</fieldset>
<fieldset>
[+tve.Color:filter->9+]
</fieldset>
<fieldset class= "sendForm" >
<input type= "submit" name= "search" value= "Search"/>
</fieldset>
</form>
The call and placeholders
[[tvExplorer? &dittoName=`Ditto`&formTPL=`formVin`&dittoSnippetParameters=`tpl: testPHX2|summarize:30|debug:1|paginate:1|depth:5|parents:23`]]
[+tve.searchForm+]
<h3>nb documents: [+total+] </h3>
<div id= " ditto_list " > [+tve.dittoList+] </div>
<p class= " ditto_pagination " >Page <strong> [+currentPage+] </strong> of <strong> [+totalPages+] </strong></p>
<p class= " ditto_pagination " > <span id= " ditto_pages " > [+previous+] [+pages+] [+next+] </span></p>
:-)