Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-09-15 18:30:08

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Search Page

I tried that code snippet, seems you can’t nest it, it doesn’t show the HR, I’m curious though, say for instance you created an article in two diff sections and then added one to the first, would it show it by section or show the first two sections and then repeat the first with the latest article?

EDIT: Just double checked, basically it’s showing the articles in hierarchical order of date, and section second, so if i get a article newer than all others, it posts the section twice, how do i stop this? PLEASE

Last edited by driz (2008-09-15 18:56:16)


~ Cameron

Offline

#14 2008-09-15 19:11:07

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Search Page

See sort attribute and it’s values.

So we get sort="Section asc" that should be placed to your <txp:article />-tag.

Offline

#15 2008-09-15 19:52:36

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Search Page

Gocom wrote:

See sort attribute and it’s values.

So we get sort="Section asc" that should be placed to your <txp:article />-tag.

That works quite nice :) Thanks. x


~ Cameron

Offline

#16 2008-09-15 22:04:35

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Search Page

How do I get it so say they search for something, and they have no results, and I want to put something saying this. I’ve tried adding a txp else tag to the search_results form, but no luck :S


~ Cameron

Offline

#17 2008-09-15 22:05:40

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Search Page

Hint: there are several other search related tags (see Textbook)

Offline

#18 2008-09-15 22:10:44

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

Offline

#19 2008-09-15 22:11:00

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Search Page

These are only ones i see :S

<txp:search_input />
<txp:search_result_count />
<txp:search_result_date />
<txp:search_result_excerpt />
<txp:search_result_title />
<txp:search_result_url />
<txp:search_term />


~ Cameron

Offline

#20 2008-09-15 22:12:26

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Search Page

I

Offline

#21 2008-09-15 22:13:58

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Search Page

driz wrote:

These are only ones i see :S

Look for i, like if. There you will find if_search_results and it’s other search related conditional friends.

Edit: Dang, not Jon nor John, but Jon-Michael, JM, beat me :P

Last edited by Gocom (2008-09-15 22:15:46)

Offline

#22 2008-09-15 22:16:26

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Search Page

Okies, I have this so far, but even WHEN they have a legitimate search it’s still saying Sorry…

					<txp:if_search>
	<p style="font-size:2.5em;">You searched for: <txp:page_url type="q" /></p>
<txp:else />
<p>begin searching by typing in the search box in the top right corner</p>
	</txp:if_search>
			</div>

		<div id="body">

        <div id="maincontent" style="width:980px;">

<div class="innerBlocks">

<txp:if_search_results>
<p>These articles match your search request: </p>
<txp:else />
<p>Sorry, we were not able to find a page matching your search request <strong><txp:search_term /></strong>.</p>
</txp:if_search_results>

	<txp:if_search>

	<txp:article form="search_results" sort="Section asc" />

	<txp:else />

	<p>No Content Available...</p>

	</txp:if_search>

~ Cameron

Offline

#23 2008-09-15 22:20:33

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

Re: Search Page

Honestly, do you ever take some time to read?

Edit: sorry, spoke too soon :(
I think you need only one set of if_search tags, wrap that entire block of code in it.

Last edited by els (2008-09-15 22:25:08)

Offline

#24 2008-09-15 22:23:46

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Search Page

Els wrote:

-Honestly, do you ever take some time to read

What? :S How does those attributes change anything? They’re for the max and min only right, unless I’m missing something, please explain. x


~ Cameron

Offline

Board footer

Powered by FluxBB