Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-30 08:45:28

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

New tag: if_form_was_called

Not sure that such tag would be very-very useful :)

<txp:if_form_called form="blabla">
<!-- Do something if before this condition form "blabla" was called -->
<txp:else />
</txp:if_form_called>

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

#2 2008-05-30 09:12:50

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

Re: New tag: if_form_was_called

LOL… well, if not even the person submitting a feature idea is sure whether the feature is useful, then there’s really no point in discussing it ;)

Offline

#3 2008-05-30 09:14:09

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: New tag: if_form_was_called

Hi Victor doesn’t this exist already with the override form?

The current system is more user friendly as if an override form is not chosen, the default is used.

Maybe I cannot see the value of your suggestion. Can you give further examples and how your idea might be different to override forms?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2008-05-30 09:27:59

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

Re: New tag: if_form_was_called

Ok. I developed :) this plugin when read the post about inserting form in the article.

So, the idea is – if i inserted desired form in the article, than i don’t ned one more instanse of this form on my site. If not – insert form somewhere :)

OF course, you can say that this could be done with custom_fields and inserting there some value that says “yes, i’ve inserted the form in article”. But this will work only among articles.

So, never mind :)


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-05-30 17:24:17

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: New tag: if_form_was_called

¿ chh_if_data ?

Last edited by mrdale (2008-05-30 17:25:00)

Offline

#6 2008-05-30 18:13:04

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: New tag: if_form_was_called

In the next release (i.e. 4.0.7), you could protect a form from being used more than once by this

<txp:if_variable name="gotadsense">
<txp:else />
<txp:variable name="gotadsense" value="yep" />
<script>
//... google code goes here ... 
</script>
</txp:if_variable>

You could imitate this behaviour in 4.0.6 with a little bit of PHP.

Offline

#7 2008-05-30 20:36:25

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

Re: New tag: if_form_was_called

Ouch! Nice example! Looks like coockies in textpattern :)


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

Board footer

Powered by FluxBB