Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-16 12:30:24

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Syntax of txp:output_form

Hi

I dont know if this is useful change but tag txp:output_form has a property “form”, why not changing it to “name” like txp:section or txp:category, to have same logic like other txp tags!

Thanks

Offline

#2 2008-06-16 15:13:08

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Syntax of txp:output_form

You are right, but I suppose it must remain so for backward compatibility

Offline

#3 2008-06-16 15:27:24

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

Re: Syntax of txp:output_form

I think that kind of change can be searched for and modified during “update” ie. when you log in for the first time after updating your files. I believe it would be part of the /textpattern/update/_to_4.0.7.php file or whichever version we had reached when it was done. I could always be wrong about that of course. ;)

Last edited by thebombsite (2008-06-16 15:29:29)


Stuart

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

Offline

#4 2008-06-16 15:59:51

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: Syntax of txp:output_form

Stuart – i think making search\replace output_form form with output_form name can be done. But i’m not sure that such things a very for site owner :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#5 2008-06-16 16:49:10

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Syntax of txp:output_form

Dragondz wrote:

I dont know if this is useful change

Neither do I ;)
Section and category are different things in my opinion, we don’t use forms to display them, so we use the attribute name. Ouput_form from my point of view has more in common with these tags: article, article_custom, linklist, comments, (mmm… we don’t have <txp:image form="..." /> yet, do we…)

Offline

#6 2008-06-16 18:05:32

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Syntax of txp:output_form

In all the places where a tag attribute refers to a form, that attribute is called … form. The output_form tag is consistent with all the other tags, I think. (um, yeah, what Els said, basically)

The image tag won’t get a form attribute. In time, I think it may be better to create an image_list tag instead, similar to how files/links work.

Last edited by ruud (2008-06-16 18:07:44)

Offline

#7 2008-06-16 19:31:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: Syntax of txp:output_form

ruud wrote:

In time, I think it may be better to create an image_list tag instead, similar to how files/links work.

*slaver* yes please.

Sorry for the OT but having a $thisimage array in the global scope would be the cherry on the cake for my next major plugin (music swells). Would probably also have the side-effect of making the myriad gallery plugins either a) obsolete or b) simpler to implement. Yay!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2008-06-16 22:19:00

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Syntax of txp:output_form

Stef, just create your own global, others can then build on top of it. hak_article_image does that.

I actually have a hak_image plugin that I’ve been working on that does that (global $thisimage and an image_list function). It sort of works and I’ve used it on a few sites but it’s not fully fleshed out yet.

I should probably just release it an let others tear it apart.

Last edited by hakjoon (2008-06-16 22:19:13)


Shoving is the answer – pusher robot

Offline

#9 2008-06-16 22:51:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: Syntax of txp:output_form

[ Sorry to continue to hijack this thread with semi-off-topicness].

hakjoon wrote:

just create your own global, others can then build on top of it.

Hmm, yeah. Suppose I could do that. But the plugin I have started is kind of reliant on the core giving me stuff (and is the reason for my request that resulted in changeset 2912). It’ll become clearer when it nears completion but the client side tags are causing me some conceptual hassles :-(

I actually have a hak_image plugin that I’ve been working on that does that (global $thisimage and an image_list function).

Sounds like the thing ruud mentioned above. Would you consider submitting it as a patch after it’s been through some testing? Otherwise, if it creates a $thisimage global won’t it clash with the “official” global when/if it comes along?

As it stands, the lack of consistency between the useful way that articles/links/files work (at the global level) and images being this homeless vagrant that occasionally gets a global meal ticket, requires quite a bit of conditional messing around. Sounds like hak_image might well bridge the gap and if it could be shoehorned into the core I’d be a happy bunny.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#10 2008-06-16 23:13:21

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Syntax of txp:output_form

For now, consider $thisimage reserved for future use.

Offline

#11 2008-06-16 23:38:01

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Syntax of txp:output_form

For the record, it actually creates a $hak_thisimage global following good plugin naming conventions. I was just using $thisimage for illustrative purposes.

Last edited by hakjoon (2008-06-16 23:38:28)


Shoving is the answer – pusher robot

Offline

#12 2008-06-17 09:18:32

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: Syntax of txp:output_form

Section and category are different things in my opinion, we don’t use forms to display them, so we use the attribute name. Ouput_form from my point of view has more in common with these tags: article, article_custom, linklist, comments, (mmm… we don’t have <txp:image form=”…” /> yet, do we…)

Interesting point of view, but in my mind always when i write txp:output_form the attribut name came to my mind and not form, then i must always check textbook to verify, we can also say using name instead of form cause we talk about the name of a form ;)
in code we can make both form and name works in same time :

function output_form($atts)
	{
		extract(lAtts(array(
			'form' => '',
            'name' =>'',
		), $atts));

if (!$form && !$name) trigger_error(gTxt(‘form_not_specified’)); else if (!$form) return parse_form($name); else return parse_form($form); }

it s only quick code.

Cheers.

Offline

Board footer

Powered by FluxBB