표현 엔진 검색에 약간의 문제가 있습니다! 나는 위대한 작품 양식을 드롭 다운있어,하지만 난이 검색 양식에 OPTIONAL 키워드 필드를 추가해야합니다. 난 내 현재 코드와 함께이 작업을 수행 할 수 있습니다 모든 아이디어를 어떻게 :표현 엔진 고급 검색 - 키워드 검색 문제
기본 폼 코드 :
<form method="post" action="/properties/search-results/">
<p>Keywords:</p>
<input id="keywords" type="text" name="keywords"/>
<p>Town:</p>
<select id="town" name="cat[]" multiple="multiple">
<option value="" selected="selected">Any</option>
{exp:channel:categories channel="property" style="linear" category_group="1"}
<option value="{category_id}">{category_name}</option>
{/exp:channel:categories}
</select>
<p>Property Type:</p>
<select id="propertyType" name="cat[]">
<option value="" selected="selected">Any</option>
{exp:channel:categories channel="property" style="linear" category_group="2"}
<option value="{category_id}">{category_name}</option>
{/exp:channel:categories}
</select>
<input style="margin-top:20px; width: 100px;" type="submit" name="submit" value="Search"/>
</form>
검색 결과 템플릿 :
<?php
// Grab the categories selected from the $_POST
// join them with an ampersand - we are searching for AND matches
$cats = "";
foreach($_POST['cat'] as $cat){
// check we are working with a number
if(is_numeric($cat)){
$cats .= $cat."&";
}
}
// strip the last & off the category string
$cats = substr($cats,0,-1);
?>
{exp:channel:entries channel="property" dynamic="on" category="<?php echo($cats);?>" orderby="date" sort="asc"}
나는에서 검색하는 키워드 필드에 필요한 { 내 항목의 제목}!
도움 주셔서 감사합니다.
은 아무도 이것을 알고 있나요 ??? – kala233