Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
The forms shall be used by the settings of custom field value ...
Hello
I’ve the following problem:
<txp:if_custom_field name="x">
<txp:output_form form="<txp:custom_field name="x" />-y" />
</txp:if_custom_field>
If a special custum-field (name x) holds a value i.e. the Letter A, then the output-form A-y shall be used, otherwiese no.
But this formular does not work. Does anyone have an idea?
Best regards
Wolfgang
Last edited by Wolfgang (2008-12-25 10:47:15)
Offline
Re: The forms shall be used by the settings of custom field value ...
You don’t need the output_form there, try just the custom_field tag and see what you get.
<txp:if_custom_field name="x">
<txp:custom_field name="x" />-y
</txp:if_custom_field>
Offline
Re: The forms shall be used by the settings of custom field value ...
> You don’t need the output_form there, try just the custom_field tag and see what you get.
Ok, then I get the text A-y and not the content which is stored in the form with the name A-y
Offline
Re: The forms shall be used by the settings of custom field value ...
Have you tried single quotes?
<txp:output_form form='<txp:custom_field name="x" />-y' />
Last edited by thebombsite (2008-12-25 11:41:00)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: The forms shall be used by the settings of custom field value ...
Ah I see. You can use the new if_variable tag:
<txp:variable name="custom_field_x" value='<txp:custom_field name="x" />-y' />
Put that first, then:
<txp:if_variable name="custom_field_x" value="">
<txp:custom_field name="x" />-y
</txp:if_variable>
See if that works. You’ll need 4.07 of course!
Offline
Re: The forms shall be used by the settings of custom field value ...
<txp:output_form form='<txp:custom_field name="x" />-y' />
This will produce the result:
-y' />
And the other part, you are right, I shall update the version.
Offline
Re: The forms shall be used by the settings of custom field value ...
Wolfgang, if you are using 4.06 neither of the two methods will work. Can you update first and then try both methods, and let us know what works/does not work?
Offline
Re: The forms shall be used by the settings of custom field value ...
@Wolfgang,
your first example is ok. As bombsite said (but he did wrote it incorrectly) use single quotes:
So, this should work (on 4.0.7):
<txp:if_custom_field name="x">
<txp:output_form form='<txp:custom_field name="x" />-y' />
</txp:if_custom_field>
Last edited by maniqui (2008-12-25 14:53:22)
Offline