Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#217 2008-09-02 15:22:58
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: glz_custom_fields
husainhk
The glz_article
tag can take a category
attribute. Just use php to grab the $pretext['c']
variable and then construct the attributes array and call glz_article()
directly.
Hope that helps.
Last edited by net-carver (2008-09-03 09:40:51)
— Steve
Offline
#218 2008-09-05 01:52:27
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Re: glz_custom_fields
Thanks to Net-Carver for his assistance. (It’s still not working for me, but I’m still experimenting. EDIT: Okay, now it’s mostly working!)
Gerhard also wrote to me about my questions. This info might be helpful to others, too.
The reason for articles needing to be in the same section is for the search, not glz_article_custom. glz_article_custom is the same as article_custom, it just has a few additions for custom fields > 10 to work & the search capabilities. If you won’t be using glz_custom_fields_search_form, there’s no need to keep articles in a single section (the ones that you want the search to work against).
I have realized that this search causes a lot of problems, so it is going to be mostly re-written for v1.2.
On the second problem (when trying to sort on an glz_article_custom (or just article_custom), I got an error saying “Textpattern Warning: Unknown column”), Gerhard wrote:
The column year does not exist in the database, just as the error says. If year is your custom field, you need to use the name of that custom field. For example, if your custom_3_set has been named “year” through my plugin, in your sort you will need to use e.g.: sort=“custom_3 asc”.
Last edited by azw (2008-09-05 22:03:58)
Offline
#219 2008-09-07 19:29:18
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Re: glz_custom_fields
This question probably has a very simple answer.
In my documents section, I put this code:
<div><txp:glz_custom_fields_search_form results_page="documents" searchby="doc_type,region,year,month,day" /></div>
The results_page is the same page. So lower on the documents page, I put this code:
<txp:glz_article_custom limit="99" no_results="no_search_results" form="documents" />
If there are results, they appear appropriately.
If there aren’t results, the address bar says that the page displayed is the “documents” section, but the page is an error page that says only:
OK
The document has moved here.
Apache/1.3.39 Server at 29div.com Port 80
In that sentence “The document has moved here,” “here” is a link to the correct section: /no_search_results.
The no_results page is set up as a section called “no_search_results” with a page by that same name. I can navigate directly to that section and see the page displayed perfectly.
What am I doing wrong?
Offline
#220 2008-09-08 02:57:41
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Re: glz_custom_fields
I still haven’t fixed the problem above, but here’s a related question.
Why does the “no_results” page have to be in a separate section?
I’d like to offer a no_results page that displays the search bar so the user can try a new search right away without unnecessary clicks to get back to a search form.
For that to work, the no_results page would have to be in the same section as the articles being searched. That’s because the tags <txp:glz_custom_fields_search_form /> and <txp:glz_article_custom /> have to be in the same section as articles that are being searched.
I’m thinking that what would be great would be if “no_search” was directed to a different page template (or a form) rather than a page and section.
Is there a way to do this?
Offline
#221 2008-09-12 19:18:20
Re: glz_custom_fields
With glz_custom_fields active – the customfieldname=
attribute in <txp:article_custom />
is broken.
This issue was posted a while back.
Anyone find a resolution?
Any thoughts on a work around?
Gerhard, you still there?
Offline
#222 2008-09-15 14:44:11
Re: glz_custom_fields
Bump. (see previous post)
I’ve tried to troubleshoot – but definitely out of my depth.
Offline
#223 2008-09-16 06:07:30
Re: glz_custom_fields
Hey everyone,
first of all I would like to apologize for not being around. I know you all have a ton of questions, from skimming through the posts they’re mostly related to the search functionality and filtering articles properly (by category for example). As some of you might know, work on v1.2 is well underway, and even though lately I had very little time to cover the last 100m, the plugin is on my mind almost everyday. Most of the issues you have brought here have already been addressed in v1.2 which has a brand new search functionality, an improved help, many bug fixes and a new screencast that will exlain the new features – this time with sound because the initial one was recorded without a mike.
As far as an ETA goes, I will strive for a September delivery, although a lot is happening for me this month. Besides a new job that is keeping me on the toes from really early morning until late in the evening, I have this Rails project that has been going for a while now and basically takes my entire free time. I have been working on it since 2007 because I was always juggling things, so for the last few months I have been totally dedicated to it. As soon as I’ll see it through, I’ll be back on the plugin.
I would like to mention here a few people that had a great contribution towards v1.2, some of which think I’ve disappeared. I am still here, just totally focused on a single project (like a Zen master), totally blind to anything else outside of my Rails project.
Husain – sorry mate for bailing out
Tom – cheers for the e-mail, it was a drop in a still pond
One thing I would like everyone to know is that this plugin is more than just a really complex TXP plugin. I know you don’t know this yet, but it has already grown into something else. A few things had to happen – and they did – so right now we are on course for something much bigger. A few things still need to tick in my head, but remember this moment 1 year from now, you will look back and everything will just click, just as it did for me a few months back.
Offline
#224 2008-09-16 07:59:38
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Re: glz_custom_fields
Thanks for the update, Gerhard! The new version sounds great.
Will the “no_results” page still have to be in a separate section?
(I’ve explained this question in more detail in post #220.)
Offline
#225 2008-09-16 12:45:45
Re: glz_custom_fields
yay! I’m finally starting my first txp site where I’m using glz_custom, so I’m happy to hear there’s goodies down the line
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
#226 2008-09-29 21:37:02
Re: glz_custom_fields
Sorry for being dense, but I just don’t get how to get ranges showing…
I have a field called “Price” where a number is entered (eg. “12.00”), and I want to show it as ranges in the search dropdown (eg. $0-$4.99, $5-$9.99, etc.), instead of a list of prices that have been entered (eg, “4.00, 12.99, 14.25, etc.). How do I do that?
I read the help, but I just don’t get it. Where am I supposed to put “Price range $”? Is it in the Extenstions tab where you enter the field name? or is it in the glz_custom_fields_search_form tag? Or is it somewhere else?
I’ve been trying different ways, but it doesn’t work…
Sorry if it’s too basic, but I can’t figure it out.
PD: I also get a 200 error when there is no search results… People have to click in the link to be redirected.
Last edited by coopersita (2008-09-29 21:49:47)
Offline
#227 2008-09-30 05:25:37
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Re: glz_custom_fields
Hi, Coopersita,
I don’t think the plug-in will do what you want. But, just in case this might be helpful, I’ll try to explain how I think it works.
I’ve never used ranges, but I think I understand the instructions. The instructions aren’t crystal clear, so it’s not a surprise that you’re having trouble.
1. Go to the Extensions tab, then choose the Custom Fields sub tab.
When you set up a range, you do it by creating a new custom field or editing an existing custom field. The field itself will have several selects. The value of each will be a range.
2. Choose an empty custom field (or an existing custom field that you want to reuse) and click on Edit.
3. Type a Name for your custom field, if it’s a new one. Here’s where the instructions are particularly difficult because it’s not a typical custom field name. The instructions say the name must be:
Price range £(after)
I think yours will be:
Price range $
That’s a guess. I don’t think you need “(after)” because your unit name comes before. And you need $ rather than £. I don’t think if there is a entity symbol code for “$” like there is for euro, pound, yen, and cent. I’m also not sure that you’d put “after”. I’m guessing that “¢” would require “(after”), but $ would not. This will require experimenting.
4. Then you choose “Select” as the Type.
5. Then next to Value you have to type in the values for each of the selects. In this case, you’ll be typing in a range of values. The instructions say to type in:
Ranges are defined 10-20, 21-30 etc. (no measuring units - they get pulled from the custom set name).
I interpret that to mean you have to type things like:
0-4.99
5-9.99
10-14.99
Use no units in your ranges. I’m not sure if the cents will work, but I assume so.
Each separate line in the value textbox will create a separate select value.
This scheme doesn’t allow you to enter a specific price (such as $12.32) for this custom field “Price” when you’re filling in the data for an article. Your only option will be to choose from the fixed selects you’ve just added in the “Custom Fields” tab. In the current implementation, I think, searching by ranges is possible only because the actual data is stored as ranges.
If this doesn’t work for you (and I doubt it will), you may want to use a type of “Text Input” and then write some php code that will organize results.
Offline
#228 2008-09-30 15:23:57
Re: glz_custom_fields
Thanks azw,
I actually already had something like that. I did have a Price Range field already set up (I guess I can just add the $ at the end and see what happens). I just find it repetitive to have a Price field for the exact price, and a Price Range for the search dropdown… But if you name your field “Price range $”, won’t it say “Select Price range $” in the dropdown? That doesn’t seem right…
In any case, I’ll just keep it the way it is (Price and Price Range). Did you find out the problem with the no_results page? I get that 200 error with the link to redirect too…
Offline