Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2011-07-20 19:21:20

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: [howto] Create an advanced search on your site

Hi, I need a small help from you. You have help me alot in building the real estate site.

See my progress here Link

I am doing very same thing like you did but I keep questioning myself you you manage to show the http://www.meijishowa.com/
and show search result like this http://www.meijishowa.com/?s=photography&c=&place=&period=Taisho&year=&artist= while staying on the index page while showing different datas.

Did you use something with <txp:if_search_results> or <txp:if_search>, I cant seem to get those tags working.

Is there anyway I could peek at your code by email or offer me an advice here.

Thank you


<txp:way_too_cool />

Offline

#14 2011-07-20 23:50:50

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: [howto] Create an advanced search on your site

Dimitri, I use several if statements for the index page. This, as it were, creates several formats for the index page. It is a bit heavy on the server, though.

<txp:if_category>
<!-- start list format -->
<txp:output_form form="head" />
<txp:output_form form="get_url_values" />
<txp:output_form form="top" />
<!-- container start -->
<div id="container">
<div id="container_middle_images">
<txp:if_individual_article>
<txp:article form="single" />
<txp:else />
<txp:output_form form="image_list" />
</txp:if_individual_article>
<div class="clear"></div>
</div>
<!-- foot -->
<div id="foot">
<txp:output_form form="about" />
</div>
</div>
<!-- container end -->
<txp:output_form form="stats" />
</body>
</html>
<!-- end list format -->
<txp:else />
<txp:variable name="f" value='<txp:sab_substr limit="2" trail=""><txp:page_url /></txp:sab_substr>' />
<txp:if_variable name="f" value="/?">
<!-- start list format -->
<txp:output_form form="head" />
<txp:output_form form="get_url_values" />
<txp:output_form form="top" />
<!-- container start -->
<div id="container">
<div id="container_middle_images">
<txp:if_individual_article>
<txp:article form="single" />
<txp:else />
<txp:output_form form="image_list" />
</txp:if_individual_article>
<div class="clear"></div>
</div>
<!-- foot -->
<div id="foot">
<txp:output_form form="about" />
</div>
</div>
<!-- container end -->
<txp:output_form form="stats" />
</body>
</html>
<!-- end list format -->
<txp:else />
<!-- start front page -->
<txp:output_form form="head" />
<txp:output_form form="top_front" />
<!-- container -->
<div id="container">
<!-- front logo -->
<div id="head">
<h1 id="logo"><a href="<txp:site_url />?all"><txp:site_name /> — <txp:site_slogan /></a></h1>
<txp:output_form form="search_large" />
</div>
<!-- front middle -->
<div id="container_middle_front">
<div id="calendar_data">
<h2>What's on the <a href="calendar/?c=<txp:output_form form="month_long" />">Calendar for <span style="text-transform:capitalize"><txp:output_form form="month_long" /></span></a>?</h2>
<txp:article_custom section="calendar" limit="4" form="calendar_front" category="<txp:output_form form="month_long" />" sort="rand()" /></div>
<div id="slide_show"><txp:output_form form="slideshow" /></div>
<div class="clear"></div>
</div>
<!-- foot -->
<div id="foot">
<txp:output_form form="about" />
</div>
</div>
<txp:output_form form="stats" />
</body>
</html>
<!-- end front page -->
</txp:if_variable>
</txp:if_category>

Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#15 2011-07-21 07:04:41

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: [howto] Create an advanced search on your site

Looks interesting. I will have a deeper look at it.

Somehow I was about to write a message to you that I managed to achieve what I desired for with <txp:smd_if>

<txp:smd_if field="urlvar:type">
<ul>
   <txp:article limit="5" >
    <li>
         <txp:title /><br />
        Bed: <txp:custom_field name="bed"/><br />
        Where: <txp:custom_field name="where"/><br />
        Section : <txp:section title="1" /><br />
       Bath: <txp:custom_field name="bath"/><br />
       Price: <txp:custom_field name="price"/><br />
       Type : <txp:custom_field name="type"/><br />
     </li>
     </txp:article>
</ul>
<txp:else />
 HOME PAGE GOES HERE
</txp:smd_if>

<txp:way_too_cool />

Offline

#16 2011-07-21 07:27:03

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: [howto] Create an advanced search on your site

Good luck, Dimitri!


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#17 2011-07-21 07:28:12

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: [howto] Create an advanced search on your site

Forgot to say something.

Thank you :)


<txp:way_too_cool />

Offline

#18 2015-01-26 20:14:52

Bobolin
New Member
From: Bulgaria
Registered: 2015-01-26
Posts: 3

Re: [howto] Create an advanced search on your site

Kjeld, sample that you show here work very well. But there is something strange. When the option form is named “s” search not perform only in section but everywhere. However, when the option form is named “c” search works exactly as expected and looks only in that category. Does anyone have an explanation for this?

Offline

#19 2015-01-26 22:51:52

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: [howto] Create an advanced search on your site

Bobolin wrote #287758:

Kjeld, sample that you show here work very well. But there is something strange. When the option form is named “s” search not perform only in section but everywhere. However, when the option form is named “c” search works exactly as expected and looks only in that category. Does anyone have an explanation for this?

I have no idea, Bobolin. The section search works fine for me. See it in action here.


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

Board footer

Powered by FluxBB