Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2011-03-23 18:03:43

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?

Hmm.

It seems logical that it should work since you are in the right context. Provided the <txp:title tag> is contained within <txp:article> tags. (edit: either on the page or via a form). Either on the page or via a form. But I could be wrong. It wouldn’t be the first time :)

Last edited by maverick (2011-03-23 18:05:13)

Offline

#14 2011-03-23 18:15:04

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

How about using adi_gps and sending the Article Title as a url parameter?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#15 2011-03-23 18:19:21

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 placed this in the article page:

<txp:article>
<div id="popup_name" class="popup_block">
    <txp:zem_contact to="ma@gmail.com" label="" thanks="Thank you.">
<fieldset>
<ol>
<li><txp:zem_contact_text label="Name:" name="ime" break="" /></li>
<li><txp:zem_contact_email label="Email:" name="email" break="" /></li>
<li><txp:zem_contact_text label="Subject:" default="<txp:article><txp:title /></txp:article>" name="tema" break="" required="0" /></li>
<li><txp:zem_contact_textarea label="Message:" name="msg" break="" /></li>
<txp:zem_contact_submit label="Send message" />
</ol>
</fieldset>
</txp:zem_contact>
</div>
</txp:article>

tried also to placed inside the article itselt, but the code in default=”…” always give me exactly what it says there, its not executing.

Tried also default=”<txp:title/>” and no luck.

Last edited by AndrijaM (2011-03-23 18:21:14)

Offline

#16 2011-03-23 18:25:28

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

This would repeat your form for each article returned by txp:article. I think you need to use adi_gps plugin and create your link to the contact form with the title in it. So in your article you’d have:

<a href="<txp:site_url/>contact-form?article-title=<txp:title />">Link to Contact Form</a>

and your form could use

<li><txp:zem_contact_text label="Subject:" default="<txp:adi_gps name="article-title" />" name="tema" break="" required="0" /></li>

Warning: not tested.

My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#17 2011-03-23 18:30:19

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?

MattD wrote:

How about using adi_gps and sending the Article Title as a url parameter?

I think the problem is that this

default=”<txp:article><txp:title /></txp:article>” or default=”<txp:title />”

is not executing in any way, it just displays what I put there, no mather what I place there.

Offline

#18 2011-03-23 18:35:50

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?

default=”<txp:adi_gps name=“article-title” />”

what would that return, url like my-article-title ? Doesn’t look pretty for subject, I’ll leave that as the last option if nothing else comes out.

Offline

#19 2011-03-23 18:38:30

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?

Why is this code not executing:

default=”<txp:php>$subject = ‘test’; echo $subject;</txp:php>”;

that is my problem I think…

Offline

#20 2011-03-23 19:17:46

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

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

Try with single quotes when you use a txp-tag as an attribute of another txp-tag (=process this tag and put the result here), e.g.:

<txp:zem_contact_text label="Subject:" default='<txp:article><txp:title /></txp:article>' name="tema" break="" required="0" />

You don’t need single quotes in HTML tags, only when using txp tags as attributes of other txp-tags.

Otherwise, both the methods proposed above seem promising:

  1. a hidden inline div within your article page that is displayed in a modal box using a modal box script. Many modal box plugin libraries come equipped with that use case built in, e.g. thickbox (see “show hidden model content” demo).
  2. passing the title as a GET (or POST) variable to an external zem_contact_reborn page that you load in the modal box and use the adi_gps plugin to retrieve the variable from the url (or form button) and insert it as the subject (again using single quotes for the attribute ... default='<txp:adi_gps name="article-title" />' ....).

Maybe there’s just an implementation error? Some suggestions:

For 1) start by just making a zem_contact_reborn form in a div at the end of your article and get that to work. Then deal with hiding it and making a popup in a second step.

For 2) If you get it working but find your title gets broken because of the spaces it contains, trying using a POST-variable instead of an url with ?article-title="<txp:article><txp:title /></txp:article>".


TXP Builders – finely-crafted code, design and txp

Offline

#21 2011-03-23 19:45:09

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

AndrijaM wrote:

what would that return, url like my-article-title ? Doesn’t look pretty for subject, I’ll leave that as the last option if nothing else comes out.

No, it would return the value of the url parameter “my-article-title” which you’d set on the previous page with

<a href="<txp:site_url/>contact-form?article-title=<txp:title />">Link to Contact Form</a>

My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#22 2011-03-23 19:48: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?

Try with single quotes when you use a txp-tag as an attribute of another txp-tag (=process this tag and put the result here), e.g.:

THATS IT!

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

that works! :)

thanks Jakob, and thank you all guys for helping out!

Last edited by AndrijaM (2011-03-23 19:50:29)

Offline

#23 2011-10-21 01:37:15

mlarino
Member
Registered: 2007-06-29
Posts: 367

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

Hi,
I am trying to do the same thing, using a form that sends the title of the article.
Got that working when the form is in the page, but when I put it in an inline div that is hidden with css, and then open it in a modal window, I can’t fill in the form.

any ideas why this is happening?
I am using Prettyphoto

Offline

#24 2011-10-21 10:32:32

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

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

mlarino wrote:

I can’t fill in the form.

What exactly does that mean?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB