&otOk;. This extension allows you to limit your weblog:entries calls by a custom field. So a theoretical call could look like any of these:
{exp:weblog:entries custom_field="pattern"}{title}{/exp:weblog:entries}
{!-- any entry with 'pattern' in the custom field --}
{exp:weblog:entries custom_field=;>100239320"}{title}{/exp:weblog:entries}
{!-- any entry where custom_field is greater than 100239320 --}
{exp:weblog:entries custom_field="<100239320"}{title}{/exp:weblog:entries}
{!-- any entry where custom_field is less than 100239320 --}
{exp:weblog:entries custom_field="=pattern"}{title}{/exp:weblog:entries}
{!-- any entry where custom_field exactly matches "pattern" --}
{exp:weblog:entries custom_field="!pattern"}{title}{/exp:weblog:entries}
{!-- any entry where "pattern" is not in custom_field --}
{exp:weblog:entries custom_field="!=pattern"}{title}{/exp:weblog:entries}
{!-- any entry where custom field does not exactly match "pattern" --}
Let me know if this helps/breaks everything it’s definitely in alpha development.
I’ve got a fairly resource-intensive template which, among other things, pulls in only those entries for a specific weblog where a certain custom field has been filled out. So it doesn’t check for a specific string, it just checks whether the field is filled out. Can I use this extension for that too, and would it be less resource-intensive than the conditional I am currently using?
It may be faster for you because the processing happens before the templating engine is run. Please do give it a try and let me know how it works. If you have any trouble with implementation let me know and I’ll lend a hand. I’d love to see how this extension really handles itself in the wild.
Will give it a try. 😊 I am not quite sure, however, how I would construct the pattern to tell it to look for the specific custom field only when said custom field has any content. I tried adding custom_field=”motto” to my weblog:entries tag, but the result is that all entries are returned, not just those where that custom_field exists.
the syntax should be field_name=”value” so if I had a field named description I could search for all descriptions about dogs like so {exp:weblog:entries description="/dogs/"} or if I wanted to see where description was not empty you could try {exp:weblog:entries description="/^$/"}. I’m not sure if that will work, but give it a try. I’ll test it out later today and get back to you.
maybe you could PM me the login to you EE install and I’ll take a look. As far as I can tell that should work. Do you have any other extensions installed? Is it listing all the entries in your system? Can you try limiting it to a specific weblog and see that does in fact change the returned entries? Thanks
Extensions:
Link Entry from the Control Panel to Your Site (v.1.0.3) Amazon pop-up search (v.1.0.0) Custom Fields in EE Tags (v.1.0.1) Multi Drop-down List (v.1.0.0) NoFocus (v.1.0.0) Trackback Expiration Extension (v.1.00)
I doubt they’re conflicting, but the actual tag I am using is fairly busy in itself, so it could very well be another conflict. Here’s what I am doing:
<ul> {exp:weblog:entries weblog="weblog24" 24_motto="/.+/" category="98" entry_id="not 445" limit="100" orderby="title" sort="asc" disable="member_data|pagination|trackbacks"} <li>{if {current_weblog_id}_book_status == “Dead”}{{/if}{title}{if {current_weblog_id}_seat} of {{current_weblog_id}_seat}{/if}{if {current_weblog_id}_book_status == “Dead”}}{/if} - {{current_weblog_id}_motto}</li> {/exp:weblog:entries} </ul>
Its supposed to pull all entries from the specific weblog and category that has a motto (field: 24_motto), but instead it pulls all the entries from the specific weblog and specific category. I suspect it may break because of those other limitations, perhaps?
try disabling the multi drop-down list. there may be a bug in v1.0.0. also try moving the 24_motto=”/.+/” to the end of the call like so:
{exp:weblog:entries weblog="weblog24" category="98" entry_id="not 445” limit="100" orderby="title" sort="asc" disable="member_data|pagination|trackbacks" 24_motto="/.+/"}
also make sure that 24_motto is the short name of your field. if it is you’re good, i’ve never used numbers in my short names like that, but that shouldn’t be causing the issue.
Double-checked the short name field, its correct. I use the number of the weblog in case I ever have two fields with the same name in different groups, and it works fine for everything else, so it shouldn’t be the issue.
I also disabled the multi drop-down and moved the check on the custom field to last in the entries tag, but no luck. I think I will try breaking the code out into a separate template, just to make sure its not failing due to any of the other code in there (its a very busy template even outside of that particular tag).
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.