Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-06-12 20:07:13

mwaldtha
Archived Plugin Author
From: Colordao
Registered: 2006-04-02
Posts: 19
Website

Individual Article Appears In Search Result Area

Hi All.

I have the following code on a page:

 <div id="articlecol">
    <txp:if_individual_article>
      <txp:article form="article_meta" limit="1"/>
    <txp:else/>
      <txp:output_form form="archive_articles" />
    </txp:if_individual_article>
  </div>
  <div id="archivecol">
    <txp:output_form form="archive_list" />
    <txp:search_input label="" button="find" section="articles" />
    <p>Enter a search term above to find previous articles.</p>
    <txp:article pgonly="1"/>
    <txp:article form="search_results" />
  </div>

The search functionality works fine, however, when I am viewing an individual article instead of the article list, the article content also appears in the space for the search results. My search_results form has everything wrapped in an if_search tag, which I thought would prevent this from happening, but I guess I was wrong.

I’m thinking the problem is related to the two txp:article tags, but I’m not sure

Any suggestions on how to resolve this?

Thanks,
- Marc

Offline

#2 2007-06-12 21:54:42

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Individual Article Appears In Search Result Area

Try using the if_search tag on your page, instead of in the search_results form.

Offline

#3 2007-06-13 01:18:45

mwaldtha
Archived Plugin Author
From: Colordao
Registered: 2006-04-02
Posts: 19
Website

Re: Individual Article Appears In Search Result Area

Thanks. Once I wrapped both of the search related article tags with if_search like so:

    <txp:if_search>
      <txp:article pgonly="1"/>
      <txp:article form="search_results" />
    </txp:if_search>

it worked as I expected.

Thanks again.

- Marc

Offline

Board footer

Powered by FluxBB