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.
Ahh, okay. Misunderstood the syntax. However, using ”/^$/” to check for not empty does not, unfortunately, seem to work. It results in no entries at all being returned.
hum..well that’s because i was dumb. searching for /^$/ would return only empty descriptions. you would actually need to search for /.+/ which would return all entries with content in them.
I have updated the extension to play nice with other extensions using the same hook, so you’ll need to update if you’re running multiple extensions that alter the template output. See the first post to get the most up to date extension.
I grabbed the new version (and disabled and reenabled the extension to make sure it was updated), and changed the tag to {exp:weblog:entries motto=”/.+/”}, but this still ends up listing all the entries, not just those that actually have the motto custom field filled out.
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
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:
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?
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).
Hi, not helping much but I’ve just tried the extension and again it doesn’t seem to be working…
I was hoping the below code would only display entries where ‘casestudy-thumb’ contained content. stripping the limit and orderby parameters, disabling other extensions doesn’t help either.
<dl> {exp:weblog:entries weblog="studies" limit="1" orderby="random" casestudy-thumb="/.+/"} <dt><a href="{comment_url_title_auto_path}">{title}</a></dt> <dt class="image"><a href="{comment_url_title_auto_path}">{casestudy-thumb}</a></dt> <dd> <p> {exp:html_strip}{exp:char_limit total="125"} {casestudy-intro} {/exp:char_limit}{/exp:html_strip} </p> <p> <a href="{comment_url_title_auto_path}">Read the full Case Study...</a> </p> </dd> {/exp:weblog:entries} </dl>
I’ll have a chance to look into this later today, but that is helpful, and I think the problem is that it’s not recognizing custom fields with non-alpha-numeric characters (ie: underscores and hyphens). I’ll look into it, fix it and let you know.
Alright, I made a few changes and I got it working using the following field names:
* 24_body
* my-body
* my_body
You can download the most up to date version (1.0.2) above. Let me know if it helps. I’ve also updated the multi drop-down list extension in case it isn’t playing nice with this extension. you can download that here: http://expressionengine.com/forums/viewthread/38370/