Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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?
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
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
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.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
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
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
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
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:
- 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).
- 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
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>
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
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