Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-06-10 10:37:31

pexman
Member
Registered: 2016-02-27
Posts: 61

search_result goes to 404

I thaught I was ready, but a check shows no function of the search. If I give some charakters in the search-form it linked me to 404 not found, and I don`t find the reason. Normaly it shows the results in the same page.

<!-- is this result result page? also omits the pagination links below (uses pagination format within search_results.article.txp instead) -->
      <txp:if_search>

        <h1><txp:text item="search_results" /></h1>
        <txp:output_form form="search_results"/>

      <txp:else /> ...

The searchform

<form role="search" method="get" action="<txp:site_url/articles/ />">...

The form search_results

<!-- display resulting articles (10 per page) -->
  <txp:article limit="10">

    <txp:if_first_article><ul id="article-list"></txp:if_first_article>
      <li role="article" itemscope itemtype="http://schema.org/Article">
        <h4 itemprop="name"><a href="<txp:permlink />" itemprop="url"><txp:title /></a></h4>

I`m so tired and take a walk with my dog. When I come back, my car is washed, home is clean and the search-function works. I light a candle before I leave.

Offline

#2 2017-06-10 12:19:56

pexman
Member
Registered: 2016-02-27
Posts: 61

Re: search_result goes to 404

The mistake is in this term:

<form role="search" method="get" action="<txp:site_url/articles/ />">

If I change the txp-term to my domain

<form role="search" method="get" action="http://yourdomain.de/articles">

I get all search-results regular, no 404 mistake. May be it didn`t work because I had changed the settings ‘chemes of url` in /section/title

Offline

#3 2017-06-10 12:57:03

pexman
Member
Registered: 2016-02-27
Posts: 61

Re: search_result goes to 404

I have now in settings

/section/title

and in the form

<form role="search" method="get" action="http://arteurope.de/<txp:section/>">
  <h4><label for="search-textbox"><txp:text item="search" /></label></h4>
  <p><input id="search-textbox" type="search" name="q"<txp:if_search> value="<txp:search_term />"</txp:if_search>><input type="submit" value="<txp:text item='go' />"></p>
</form>

So in every page you can search and the results will offer on that page, where you have started your search.

Offline

#4 2017-06-10 13:58:54

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,305

Re: search_result goes to 404

pexman wrote #305909:

I`m so tired and take a walk with my dog. When I come back, my car is washed, home is clean and the search-function works. I light a candle before I leave.

I know situations like this. Looks like the candle magic worked (and didn’t burn your house down ;)

This here, BTW,
action="<txp:site_url/articles/ />
would have been
action="<txp:site_url/>articles"


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2017-06-12 10:23:55

pexman
Member
Registered: 2016-02-27
Posts: 61

Re: search_result goes to 404

Aha, often, after a scripting battle, always some terms got losses. Thank you.

Offline

Board footer

Powered by FluxBB