Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [SOLVED] unite article_custom and custom_field
colak wrote:
Guys, thanks sooo much for your input here but I would like to return to this slightly amended idea for a few seconds and find out why it does not work.
If you are trying to pull the content from the articles you are trying to list, then that’s not going to work. Read my post above. Custom fields are only available inside article context, i.e. inside the article custom tag, not outside. Never mind.
What doesn’t work? You have comma-separated list of values in a custom field name “c3” and one of the values is “xx”? Only problem with the code is that the filtering is done after the articles have been fetched from database. Meaning that you may end up with zero, six or ten articles, depending on how many of the ten has a matching value.
Last edited by Gocom (2011-07-25 03:18:48)
Offline
Re: [SOLVED] unite article_custom and custom_field
Gocom wrote:
Only problem with the code is that the filtering is done after the articles are fetched, and only once the artiles are being listed. Meaning that you may end up with zero, six or ten articles, depending of how many of the ten has a matching value.
Hey Jukka,
That was it! Staring me in my face and not able to see it. Changed the limit to 999 and all is working just fine.
final working code:<txp:article_custom
limit="999"
wraptag="ul" break="li"
section="texts">
<txp:if_custom_field name="c3" separator="," match="any" value="xx">
<txp:permlink><txp:title /></txp:permlink>
</txp:if_custom_field>
</txp:article_custom>
As we currently have under 100 texts and current calls and info are averaging at a maximum of 30, the 999 limit will work just fine.
Last edited by colak (2011-07-25 03:34:29)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] unite article_custom and custom_field
colak wrote:
Changed the limit to 999 and all is working just fine.
Just remember that the code is going to fetch 999 rows, or less if less are available in total. This will be really slow compared to limit of 10 when/if you have lot of articles.
Offline
Re: [SOLVED] unite article_custom and custom_field
Gocom wrote:
Just remember that the code is going to fetch 999 rows, or less if less are available in total. This will be really slow compared to limit of 10 when/if you have lot of articles.
Yes, I thought about it too! Edited the post above to highlight this limitation.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline