Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-07-17 21:03:58

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

Search with glz_custom_field

I have around 11 custom fields. I have 6 custom fields using selectors format.

Once the articles are created. How can I develop an advanced search to filter all the articles with the selectors custom fields.

I need to do something very similar to the link below
For example

I see the <txp:glz_custom_fields_search /> tag is no longer supported. What should I do now?

Any advices appreciated.

Thanx


<txp:way_too_cool />

Offline

#2 2011-07-18 16:59:16

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

Re: Search with glz_custom_field

Bump


<txp:way_too_cool />

Offline

#3 2011-07-18 21:49:52

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

Re: Search with glz_custom_field

K I have made a basic search. It goes like this

<form action="<txp:site_url />">
	<input type="text" name="q" />

	<select name="bed">
	  <option value="">---</option>
	  <option value="1">1+</option>
	  <option value="2">2+</option>
	  <option value="3">3</option>
	  <option value="4">4+</option>
	</select>

	<input type="submit"  value="Search" />
</form>

my result on the url http://site.dev/?q=welcome&bed=1
It output an article called “Welcome” but with 4 beds.
How can I make the search work with the extra query “&bed=” and how can I make it relate to my glz_custom_field called bed. I have sent more than 3 hours trying to figure out how to add new query to the search and output the result.


<txp:way_too_cool />

Offline

#4 2011-07-19 21:15:41

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

Re: Search with glz_custom_field

K well I didnt get any help (I have asked a few but they were unable to provide me a solution) :P so I managed on my own. Lots of thinking, deep ones.

All the links that helped me are here below if you need to do something similar.
Forum article
How to use it
Url to search
Pulling url into variable plugin

The only thing I cannot do is the price range with conditionals such as “==” “<=” “>=” “!=” so I skipped that part :P

I have counted, over 400 lines for my own personal advanced search :D with 5 selectors. One is category and 4 custom fields. I would like to work with 2 category groups for the search but I couldnt have two “?c=” so I used custom fields instead with adi_gps

And bear in mind, what I did above, I did not need
<txp:if_search> or <txp:if_search_results>

Last edited by Dimitri (2011-07-19 21:19:03)


<txp:way_too_cool />

Offline

#5 2011-07-21 07:17:21

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

Re: Search with glz_custom_field

Hi ppl. I am guessing you would like to see my progress.

I have noticed the search wont work on any sections but only here in the index domain.com/?q= not domain.com/section/?q=

So, without having to clash the search result and the home page. I managed to achieve with smd_if

Example:

Link

<txp:smd_if field="urlvar:q">
    SEARCH RESULT GOES HERE
<txp:else />
 HOME PAGE GOES HERE
</txp:smd_if>

<txp:way_too_cool />

Offline

#6 2011-09-19 20:39:28

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

Re: Search with glz_custom_field

Hello guys, whoever stumbles this topic.

My final product (few more still need to be uploaded).

Website Link

Also included the calendar by smd_calendar, Unfortunately I will make this password protected when the time comes. Look quick when you can
Calendar Link

Even uploaded txptips here
Gallery

Last edited by Dimitri (2011-09-19 20:42:39)


<txp:way_too_cool />

Offline

#7 2012-06-27 19:08:13

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Search with glz_custom_field

Dimitri:

This is exactly what I am looking to do. I will be taking a crack at it and let you know — but your guidance and examples are very encouraging.

progre55

Offline

Board footer

Powered by FluxBB