Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-06 22:20:01

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

[superseded] rah_output_section_form

Rah_output_section_form has been superseded by core. The form name prefixing can be done with just core output_form tags with the tags-in-tag support added in Textpattern v4.0.7 release.

The only difference is that output_form will invoke informal error messages when a missing form partial is encountered. These message are informal and harmless, and will only be visible when the site is in a debugging or a testing mode.

Fallback support can be provided with variables tags and yield allows building factory partials with just core tags.

To output a form corresponding to the current section:

<txp:output_form form='sidebar-<txp:section />' />

Using <txp:yield /> to power building factories:

<txp:output_form form="call">s-<txp:section /></txp:output_form>

Where in the above a form partial named call would contain:

<txp:variable name="form"><txp:output_form form='<txp:yield />' /></txp:variable>
<txp:if_variable name="form" value="">
	No Form named <txp:yield /> found, showing fallback.
<txp:else />
	<txp:variable name="form" />
</txp:if_variable>

The form call can contain any type of processing that is done automatically when the factory partial is used to call other form partials.

Old download links

Last edited by Gocom (2012-07-25 02:21:16)

Offline

#2 2008-10-07 01:15:18

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: [superseded] rah_output_section_form

This is a great plugin.

Used in tandem with a conditional statement, you can use it to output a custom sidebar, header, footer, or other content block, with default content on reserve for sections with no dedicated form. Conditional’s are no longer needed with version 0.2.

4.0.6 (requires chh_if_data)

<txp:chh_if_data>
	<txp:rah_output_section_form prefix="my_prefix-" />
	<txp:else />
	...
</txp:chh_if_data>

4.0.7

<txp:variable name="section-info" value='<txp:rah_output_section_form prefix="my_prefix-" />' />
<txp:if_variable name="section-info" value="">
	...
	<txp:else />
	<txp:rah_output_section_form prefix="my_prefix-" />
</txp:if_variable>

The foregoing examples used version 0.1 of the plugin— this functionality is now built in to version 0.2 through the default attribute.

Last edited by johnstephens (2008-10-28 15:18:42)

Offline

#3 2008-10-28 12:06:03

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: [superseded] rah_output_section_form

It would be really nice if there was the ability to select a default form to use if it can’t find a form that matched the prefix eg:

<txp:rah_output_section_form prefix=“side_” default=“common_form” />

Other than that – it’s already massively simplified my site.

Offline

#4 2008-10-28 12:32:23

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

Re: [superseded] rah_output_section_form

douglgm wrote:

It would be really nice if there was the ability to select a default form…

Yep.

A new version, 0.2, released. Changelog:

  • Fixed minor doSlash bug (didn’t effect anything).
  • Added default attribute.

More info and downloads

Offline

#5 2008-10-28 13:46:13

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [superseded] rah_output_section_form

Before I throw this at a site Jukka, can I ask, as I am using SVN with the latest tag-parser, will I be able to use a txp tag as a value or part-value?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2008-10-28 14:06:03

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: [superseded] rah_output_section_form

  • Added default attribute.

Wonderful! Thanks you very much!

Offline

#7 2008-10-28 14:21:46

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

Re: [superseded] rah_output_section_form

thebombsite wrote:

Before I throw this at a site Jukka, can I ask, as I am using SVN with the latest tag-parser, will I be able to use a txp tag as a value or part-value?

Yes, if you use single quotes ('), then of course, ‘cause the new TXP parser can parse those tags :)

Last edited by Gocom (2008-10-28 14:22:40)

Offline

#8 2008-10-28 15:20:00

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: [superseded] rah_output_section_form

Awesome. I was using conditionals for this purpose, but this is much more elegant.

Offline

#9 2008-10-28 15:54:50

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [superseded] rah_output_section_form

Oh good. I’ll give it a whirl then. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#10 2008-11-03 16:41:38

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: [superseded] rah_output_section_form

Any chance of “rah_output_category_form” ?

Or a parameter in the existing plugin to allow the use of category name instead of section?

Offline

#11 2008-11-03 17:22:48

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

Re: [superseded] rah_output_section_form

douglgm wrote:

Or a parameter in the existing plugin to allow the use of category name instead of section?

Probably coming this week ;)

Offline

#12 2008-11-03 18:59:08

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [superseded] rah_output_section_form

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 />" />

Offline

#13 2008-11-03 19:15:16

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: [superseded] rah_output_section_form

The correct syntax is:

<txp:output_form form="section_" />

The current section is automatically used by the plugin without using a <txp:section tag.

Offline

#14 2008-11-03 19:41:17

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

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?

Yep, it can, but would return error message too when there is no form found, and it wouldn’t return default form.

Also, this plugin is old, note: really old, initially from 2007 – before existence of 4.0.7 parser (I don’t publish my plugins always after I write’em – I just absolutely hate writing docs plus this plugins is useless now days, that is why I wasn’t even sure should i publish it :D). Also IHMO new parser method is slower (by couple ms) ;)

I would recommend not using all my plugins – this can be done with simple PHP. But i released this because all of us don’t (then) know how to use PHP. This was so said build to help clients work that want to write their own code, but don’t handle conditional tags. And because i used php version for all site i do, i thought it would be easier to use one single tag for the job, thus the plugin.

And may i correct you? Your example is wrong too – a tiny bit; note that " should be ' when using tags inside tags ;)

Last edited by Gocom (2008-11-03 19:46:14)

Offline

#15 2008-11-03 20:38:14

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: [superseded] rah_output_section_form

thanks for the clarification jukka, i thought this was a brand new plugin of yours and it therefore automatically caught my interest :)

Last edited by sthmtc (2008-11-03 20:38:37)

Offline

Board footer

Powered by FluxBB