Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-12-19 23:47:13

ecklesroad
Plugin Author
From: Bemidji, MN
Registered: 2008-02-22
Posts: 119
Website

Variable created in an article not available in form

Not sure if this will work, but if there’s a way it’ll save me a lot of replicated code.
I have a an article with this:

<txp:variable name="image_slide_category">news-events-slides</txp:variable> <txp:output_form form="image_slides" /> <txp:variable name="image_slide_category">

Then in form “image_slides” I’m trying to use the variable “image_slide_category” like so

<txp:images category='<txp:variable name="image_slide_category" />' sort="alt asc" break="">##IMAGE CODE##</txp:images>

Nothing outputs from the form but the second call to the variable “image_slide_category” in the article outputs “news-events-slides”. If I hard code in “news-events-slides” into the images tag it works fine.

Can you not create a variable in an article and then use it in a form immediately after? I want to be able to use pass in a image category name into this form instead of creating a new one for each gallery with a different name.

Last edited by ecklesroad (2012-12-19 23:48:01)

Offline

#2 2012-12-20 00:13:43

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

Re: Variable created in an article not available in form

The second <txp:variable name="image_slide_category">, is that a fault from posting or is that original code?


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

Offline

#3 2012-12-20 00:15:22

ecklesroad
Plugin Author
From: Bemidji, MN
Registered: 2008-02-22
Posts: 119
Website

Re: Variable created in an article not available in form

No, I put that in my Article code to check and see if I was able to get the variable to fire at all.

Offline

#4 2012-12-20 00:21:29

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

Re: Variable created in an article not available in form

It should have a closing slash then.


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

Offline

#5 2012-12-20 00:25:06

ecklesroad
Plugin Author
From: Bemidji, MN
Registered: 2008-02-22
Posts: 119
Website

Re: Variable created in an article not available in form

Dinged around with it for a little while and figured out the issue. My form was not updating form some reason, It just all of a sudden started to work flipping to testing, refreshing, and flipping to live. must have been a product of working on this project too long today.

Offline

Board footer

Powered by FluxBB