Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2008-11-07 17:33:17
- kyber
- New Member
- Registered: 2007-07-29
- Posts: 7
Re: [superseded] rah_output_section_form
sthmtc wrote:
i’m not sure if i’m getting this right… but isn’t this going to be obsolete with 4.0.7?
i thought that with the new tag parser you could do:
< txp:output_form form=“section_<txp:section />” />
Indeed you can and I have done so (I am running on latest SVN).
There is no error if the form does not exist.
Stuart
Last edited by kyber (2008-11-07 17:35:36)
Offline
Re: [superseded] rah_output_section_form
Gocom wrote:
Probably coming this week ;)
Any chance of category support soon? (Damn I need to learn how to write my own plugins)
Doug.
Offline
Re: [superseded] rah_output_section_form
douglgm wrote:
Any chance of category support soon?
New version, 0.3 up of rah_output_section_form. Changelog:
- Added attribute:
type. - Added category support.
douglgm wrote:
Damn I need to learn how to write my own plugins
That requires programming skills, if you don’t like it (PHP etc coding), I would advice, may not. It’s pain if you don’t like it ;)
Last edited by Gocom (2008-11-15 21:13:17)
Offline
Re: [superseded] rah_output_section_form
Many thanks for that, greatly appreciated – just need to re-work the site I’m working on!
As for writing plugins, I’m not afraid of a bit of coding – I just need a spare five minutes to get my heard round them!
Doug.
Offline
Re: [superseded] rah_output_section_form
I use this plugin a whole lot without any issues, but I’ve finally found some wonky behavior. It may be caused by something else; if the solution isn’t obvious, would you be willing to let me know how I can begin troubleshooting this?
Here’s what is going on: In my default page template, I have a tag like this:
<txp:rah_output_section_form prefix="_aside-" default="_aside"/>
This pulls in the _aside form for each section, or the default _aside form for sections without a form by that name. Works.
But this site is also using a dedicated search section called “search”. That’s the section where I’m getting wonky behavior. For the “search” section, I don’t want to output an _aside form, so I created a form called _aside-search containing only an HTML comment. When I navigate to the “search” section without a search, that’s the form I get. Here’s the tag trace:
<txp:rah_output_section_form prefix="_aside-" default="_aside"/>
[SQL (0.000143051147461): select Form from txp_form where `name` = '_aside-search' limit 1]
I get the same results on searches that return results. But if I search on a term with no results, this tag can return a variety of forms.
Let’s search for “monkey”, a term that doesn’t appear on the site. On the search page I now see the default _aside form; here’s the tag trace for that:
<txp:rah_output_section_form prefix="_aside-" default="_aside"/>
[SQL (0.000265121459961): select Form from txp_form where `name` = '_aside-authors' limit 1]
[SQL (0.000231981277466): select Form from txp_form where `name` = '_aside' limit 1]
Suddenly, the tag thinks I’m viewing the “authors” section, even though the url is mysite.tld/search?q=monkey. Everything else on the page belongs to the “search” section.
Wait. It gets stranger. Let’s search for “Monkey”, with a capital M. Now the search page is outputting a different _aside form, this time the one that goes with the “about” section:
<txp:rah_output_section_form prefix="_aside-" default="_aside"/>
[SQL (0.000307083129883): select Form from txp_form where `name` = '_aside-about' limit 1]
Any idea what’s going on here? Thanks for this awesome plugin!
Offline
Re: [superseded] rah_output_section_form
johnstephens wrote:
Any idea what’s going on here?
Do not know. The plugin just gets the section name directly from Textpattern. And she tells lies apprently.
What <txp:section /> outputs if you place it just before the <txp:rah_/> tag? Oh, and does the tag happen to be inside an article form? Full tag trace might come handy.
Offline
Re: [superseded] rah_output_section_form
Just a thought: how about a suffix attribute too?
It makes for well-sorted form lists when you use the tag a few times on a page for different purposes, e.g. main_{section-name} and main_{section-name}_js or if you quickly want to test alternate variants such as main_{section-name}_alt.
For the moment I patched a version of your plugin to do that, which I can send you if you like (although I hardly think you need it).
TXP Builders – finely-crafted code, design and txp
Offline
Re: [superseded] rah_output_section_form
jakob wrote:
Just a thought: how about a
suffixattribute too?
Well, why not :) Suffix away with v0.4. Changes:
- Added: txp:yield support.
- Added:
suffixattribute. Thank you for the suggestion Jakob. - Added: Now caches the forms.
Offline
Re: [superseded] rah_output_section_form
Cool, thanks. I’ll put into effect very soon and holler should there be a problem.
TXP Builders – finely-crafted code, design and txp
Offline