Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-03-23 13:03:13

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Is there any way to use article tags outside of article context?

Here’s my problem:

inside every article, my client wants to have a javascript pop-up window with html contact form, so the visitor can send inquiry about that particular products right from that page.

I’ve made another section called pop-up with zem_contact_reborn in it and with a little bit of javascript that’s working fine.

BUT, I need to put article title as the subject of that message.

So, because I’m in the pop-up section, I can’t use <txp:title /> or custom field from products section.

That is why I wonder if there is any way to use article tags outside of article context?

Any other suggestion how to work this out is appreciated :)

Offline

#2 2011-03-23 13:08:23

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

Re: Is there any way to use article tags outside of article context?

You could still you the article tag…

something like

<txp:article><txp:zcr tags></txp:article>


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

Offline

#3 2011-03-23 13:20:22

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: Is there any way to use article tags outside of article context?

Do you mean something like:

<txp:zem_contact_text label=“Subject:” default=”<txp:article><txp:zcr tags></txp:article>” /> this is in pop-up section.

If so, what is <txp:zcr tags> ?

Edit: ah, zcr is zem contact reborn, but I still don’t get it…

Last edited by AndrijaM (2011-03-23 13:59:21)

Offline

#4 2011-03-23 14:41:07

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

Re: Is there any way to use article tags outside of article context?

I’v called zcr before from inside an article tag. No problems at all

Offline

#5 2011-03-23 14:50:51

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

Re: Is there any way to use article tags outside of article context?

OK:) Not exactly what you want but it might help

Try something like

<txp:article><txp:zem_contact to="email@domain.tld" label=""  thanks="some message here.">
<txp:zem_contact_text label="Your name" /><br />
<txp:zem_contact_email label="Your email" /><br />
<txp:zem_contact_textarea label="Your question" /><br />
<txp:zem_contact_checkbox label="Check this box before clicking the send button" /><br />
<txp:zem_contact_send_article /> 
<txp:zem_contact_submit label="Send" />
</txp:zem_contact></txp:article>

from the plugin’s help:

<txp:zem_contact_send_article /> can be used to create a “send article” link within an article form, connecting it to the contact form.


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

Offline

#6 2011-03-23 15:01:38

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: Is there any way to use article tags outside of article context?

Guys, thanks, but I don’t need to send article. I need a contact form with name, email and SUBJECT which is taken from article title or from custom field.

That contact form needs to be javascript popup.

Btw, I tried to put this code inside my article (directly and with txp:output_form) and I get

Tag error: <txp:article> -> Textpattern Notice: article_tag_illegal_body

I don’t see how this solves my problem, or am I missing something?

Offline

#7 2011-03-23 15:03:25

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Is there any way to use article tags outside of article context?

Does this TxpTip help?

Offline

#8 2011-03-23 15:22:44

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: Is there any way to use article tags outside of article context?

Thanks, but I think this is a fancier version of what I already have.

I also created another section and I have a js pop-up window with zem contact form in it.

What I need is a way to enter a subject of that html form which is product title or custom field.

Offline

#9 2011-03-23 15:32:40

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Is there any way to use article tags outside of article context?

What if you put your contact form on your article page instead of as its own section?

ala: this tutorial

or, I’ve never tried a variable quite like this, but can you pass the article title to a variable while on a page, then use the variable in your contact section?

Last edited by maverick (2011-03-23 15:56:27)

Offline

#10 2011-03-23 15:38:57

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: Is there any way to use article tags outside of article context?

maverick wrote:

What if you put your contact form on you article page instead of as its own section?

I thought of that, but the pop-up window needs to have some kind of url, if my contact form is on the same page, don’t see how can I make it pop-up and send email with it?

maverick wrote:

or, I’ve never tried it, but can you pass the article title to a variable while on a page, then use the variable in your contact section?

now thats an idea that might work :)

Last edited by AndrijaM (2011-03-23 15:39:53)

Offline

#11 2011-03-23 15:48:12

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Is there any way to use article tags outside of article context?

AndrijaM wrote:

I thought of that, but the pop-up window needs to have some kind of url, if my contact form is on the same page, don’t see how can I make it pop-up and send email with it?

In the tutorial they use

href=”#?w=500” rel=“popup_name”

Then they have a hidden div with

div=“popup_name”

So the url you use is the hash tag combined with the rel/id of popup. This sends you to the hidden div on the page. You then would put your contact form in the hidden div, and the form should send normally.

The js code they give handles the rest.

Last edited by maverick (2011-03-23 15:51:21)

Offline

#12 2011-03-23 17:34:29

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: Is there any way to use article tags outside of article context?

I followed the tutorial, but still no luck. Everything works exept for the main problem:

<txp:zem_contact_text label=“Subject:” default=”<txp:title />” name=“tema” break=”“ required=“0” />

so I have the same problem from beginning: how to use article tags outside of article context (if possible)?

Or, if some php programmer is reading this, how can I declare and use global variable in this case? I tried but I’m not that good with php…

Last edited by AndrijaM (2011-03-23 17:35:16)

Offline

Board footer

Powered by FluxBB