Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#211 2008-08-21 12:25:52

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

Re: glz_custom_fields

Tom, is display: none an option? They all have their own IDs.


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

Offline

#212 2008-08-21 13:51:49

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: glz_custom_fields

uli wrote:

Tom, is display: none an option? They all have their own IDs.

Thanks Uli,

Sometimes it’s the simplest solution that’s the most difficult to see.

)


Tom

Offline

#213 2008-08-22 17:11:29

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: glz_custom_fields

In need of some help.

I’ve converted all 10 of the original custom fields to additional excerpts.
The mod requires that the custom fields are changed from varchar255 to text in the textpattern table.

The problem is that now that they are text they span multiple lines, so when glz_custom_fields tries to go get the content it breaks and returns

error: unterminated string literal.

Anyhow, I’ll get to the point.
I’d like to mod the plugin so that it doesn’t try to pull anything from the 1st 10 custom fields.
I’ve looked at the code, and am way out of my depth.

Any assistance would be greatly appreciated.


Tom

Offline

#214 2008-08-24 22:36:27

azw
Member
Registered: 2007-01-29
Posts: 279

Re: glz_custom_fields

I’m having trouble with two things that are probably related.

First, I wanted to use the tag, glz_article_custom. In Gerhard’s explanation it says that the articles have to be in the same section. One of the purposes of the article_custom tag was to be able to list articles from any section. Is this an error, or is glz_article_custom different?

<txp:glz_article_custom limit=“5” no_results=“no_results” form=“some_form” />
This needs to be used instead of txp:article_custom where you want the search results to appear. We need to “inject” our extra custom fields in the search query and modify it slightly. This is a straight copy of article_custom() from TXP 4.0.6 (r2085) with some “magical dust” : ).

This is not too obvious so please pay attention. If our custom search tag is set to land on section “listings” (which we define in glz_custom_fields_search_form), the articles you want searching must be belong to this section. For example, if our search points to section “listings” but our articles are saved under section “properties”, there will be no matches and thus we will be forwarded to no_results page. In this case, what we might want to do, is set results_page in glz_custom_fields_search_form to “properties”.

no_results – if no matching results are found, this is the page (section) where the users will be redirected (no_results by default)

If that wasn’t a mistake, is there a way to modify the plugin so that glz_article_custom acts like the default article_custom?

Second, when I try to sort on an glz_article_custom (or just article_custom), I get an error saying

“Textpattern Warning: Unknown column”.
Tag error: <txp:glz_article_custom section=“documents” status=“live” sort=“year asc” form=“mapdata” limit=“999” /> -> Textpattern Warning: Unknown column ‘year’ in ‘order clause’
select *, unix_timestamp(Posted) as uPosted from textpattern where 1=1 and Status = 4 and Posted <= now() and Section IN (‘documents’) order by year asc limit 0, 999 on line 81

This occurs when I’m trying to sort the listing of “markers” in a Google Maps application.
I’m using this as my model:
http://davidramos.org/thesis/google-maps-in-textpattern

Here’s the article_custom code I’ve tried:

<markers>
<txp:article_custom section="documents" status="live" sort="year asc" form="mapdata" limit="999" />
</markers>

The glz_article_custom code is:

<markers>
<txp:glz_article_custom section="documents" status="live" sort="year asc" form="mapdata" limit="999" />
</markers>

Does anyone have any thoughts on what’s going wrong?

Offline

#215 2008-08-25 16:28:15

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: glz_custom_fields

azw

that second error is occuring because there is no field called ‘year’ in the textpattern table. Is ‘year’ the name of one of your custom fields? Does this work?…

<markers>
<txp:article_custom section="documents" status="live" sort="Posted asc" form="mapdata" limit="999" />
</markers>

Hope that helps!


Steve

Offline

#216 2008-08-27 08:06:14

husainhk
Member
From: Dubai, UAE
Registered: 2007-08-12
Posts: 105
Website

Re: glz_custom_fields

Hi all,

I have a section “models” and certain categories like “males”, “females”, “kids” etc. And depending on the category name supplied in the URL “/section/?c=categoryname”, my page loads showing the relevant articles.

I am using the plugin to filter results through a search form, output by the plugin. The results show correctly when I use the <txp:glz_article /> tag, according to the plugin help. But when I access the articles from the URL (without the search form), then the <txp:glz_article /> tag shows all the articles and not by category. If I use the <txp:article /> tag then the form obviously doesn’t work, but the category name in the URL shows the right articles.

Any idea what this is and how to solve this? Please help.

The page template looks like below with the <txp:article /> tag:

<txp:if_individual_article>

	<!-- Show Full Article -->
	<h1><txp:title /></h1>
	<div id="model-container" class="clearfix">
		<div id="default-picture"><txp:hak_article_image limit="1" link="0" /></div>
			<div id="details">
				<txp:body />
			</div>
		<ul id="article-nav">
			<li id="prev-article"><txp:jra_link_to_prev sort="title asc" showalways="0">Previous Model</txp:jra_link_to_prev></li>
			<li id="next-article"><txp:jra_link_to_next sort="title asc" showalways="0">Next Model</txp:jra_link_to_next></li>
		</ul>
	</div><!-- End model-container -->

	<h1>Photo Gallery</h1>
	<txp:article form="lightbox_gallery" />

	<txp:else />

		<!-- Show Landing Page -->
		<h1><txp:category title="1" /></h1>
		<ul class="thumbnails">
			<txp:article limit="999" form="model_thumbnails" time="any" sort="title asc" />
		</ul>

</txp:if_individual_article>

Offline

#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

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

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

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

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

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

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

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

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

Board footer

Powered by FluxBB