Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Sort depending on nested terms of custom field values
Hello there,
is there any way for me to sort articles depending on values in nested custom field terms, like
<txp:if_custom_field name=“feature” val=“yes”>
<txp:if_custom_field name=“big” val=“yes”>
<p>I am featured AND I am big!</p>
</txp:if_custom_field>
</txp:if_custom_field>
I can’t seem to be able to nest those terms involving custom field values.
i am on 4.0.5 in this case.
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Sort depending on nested terms of custom field values
Nesting tags isn’t currently possible, but it will be on 4.0.7.
You can try is this:
<txp:if_custom_field name=“feature” val=“yes”>
<txp:output_form form="is_big" />
</txp:if_custom_field>
form “is_big”:
<txp:if_custom_field name=“big” val=“yes”>
<p>I am featured AND I am big!</p>
</txp:if_custom_field>
This way, nested same tags usually works.
Offline
#3 2008-06-08 06:45:48
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Sort depending on nested terms of custom field values
If moving up to the current svn revision for 4.0 is comfortable for you it’s well worth the advantages. I’m using the form that follows with jnm_audio with excellent results on a site I’m building for a friend.
It employs 2 custom fields, and the only burden on the user is the choice of whether to use the download id or the filename field.
<txp:if_custom_field name="music_file_id">
<fieldset>
<legend><txp:custom_field name="music_filename" /></legend>
<txp:jnm_audio fileid='<txp:custom_field name="music_file_id" />' />
</fieldset>
<txp:else />
<txp:if_custom_field name="music_filename">
<fieldset>
<legend><txp:custom_field name="music_filename" /></legend>
<txp:jnm_audio filename='<txp:custom_field name="music_filename" />' />
</fieldset>
</txp:if_custom_field>
</txp:if_custom_field>
Last edited by rsilletti (2008-06-09 05:12:39)
Offline
Re: Sort depending on nested terms of custom field values
Thank you very much, both.
I am using Maniqui’s method now, as i shouldn’t update a client’s website to an svn version.
Thanx very much again.
A hole turned upside down is a dome, when there’s also gravity.
Offline
#5 2008-06-09 17:28:11
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Sort depending on nested terms of custom field values
That is wise given the nature of some of the changes, even were it not svn it may lead to a significant amount of editing amongst some of the defined attributes in older templates.
Offline