We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Custom Fields in {exp:weblog:entries /}

Development and Programming

Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

Ah, okay, got it. Thank you. 😊

       
Brian M.'s avatar
Brian M.
529 posts
18 years ago
Brian M.'s avatar Brian M.

Hoping for some quick help here if possible. Can someone walk me through how to use this to show all entries that start with a certain letter? I need to allow someone to show all companies that start with A for instance. I need to also allow them to combine that with other criteria that are all set in custom weblog fields.

Thanks in advance!

       
Brian M.'s avatar
Brian M.
529 posts
18 years ago
Brian M.'s avatar Brian M.

Hmm - also this doesn’t seem to work: company_member_discount=”/.+/”

That is not returning anything, even though there are entries that have text for company_member_discount. Is that the right search for any entry that has a value in the field? I pulled it from earlier in this thread…

       
joost's avatar
joost
62 posts
18 years ago
joost's avatar joost

I can’t get to to work with segments. merk is the name of the customfield and Leolux is the variable chosen from a dropdown list. I’m confused that it doesn’t work because the code I use is pretty straightforward imo. I see no entries at all, while I checked that at least some of them have that customfield variable.

{exp:weblog:entries weblog="{master_weblog_name}" merk="{segment_3}" disable="pagination" dynamic="off"}

When I enter the variable manually (instead of using the segment var) I get also no results.

{exp:weblog:entries weblog="{master_weblog_name}" merk="Leolux" disable="pagination" dynamic="off"}

I use the url mydomain.com/models/brandname/Leolux to filter out by custom_fields.

Where is it going wrong?

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
18 years ago
Sue Crocker's avatar Sue Crocker

I don’t have an answer for you… but what if you remove dynamic=”off” – does it work then?

       
joost's avatar
joost
62 posts
18 years ago
joost's avatar joost

Doesn’t work either. I’ve no idea where it fails. :( Don’t gave to hook anything inside my mod.weblog.php because I don’t use pagination and relationships anyway, right?

       
Brian M.'s avatar
Brian M.
529 posts
18 years ago
Brian M.'s avatar Brian M.
Doesn’t work either. I’ve no idea where it fails. :( Don’t gave to hook anything inside my mod.weblog.php because I don’t use pagination and relationships anyway, right?

I had to modify mod.weblog.php before it would work even when not using pagination. I bet that fixes it for you.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
18 years ago
Sue Crocker's avatar Sue Crocker

joost, I have no idea. I don’t use that extension except on one site for testing.

       
joost's avatar
joost
62 posts
18 years ago
joost's avatar joost

Thanks for helping. As soon as I modify the mod.weblog.php I get an sql error - feeling like a noob now. After putting back the original it was gone. I’m sure I inserted the two codesnippets correct.

MySQL ERROR:

Error Number: 1064

Description: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE t.entry_id !='' AND t.entry_date < 1172932539 AND (t.ex

Query: SELECT t.entry_id FROM exp_weblog_titles AS t LEFT JOIN exp_weblogs ON t.weblog_id = exp_weblogs.weblog_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id INNER JOIN exp_weblog_data AS d ON t.entry_id=d.entry_id AND WHERE t.entry_id !='' AND t.entry_date < 1172932539 AND (t.expiration_date = 0 || t.expiration_date > 1172932539) AND exp_weblogs.is_user_blog = 'n' AND t.weblog_id = '14' AND t.status = 'open' ORDER BY t.sticky desc, t.entry_date desc LIMIT 0, 100
       
Helmi_xisnet's avatar
Helmi_xisnet
71 posts
18 years ago
Helmi_xisnet's avatar Helmi_xisnet

Hi Mark, I cant get this extension to work with Relationship custom fields. I’ve already patched the mod.weblog.php with the code.

       
joost's avatar
joost
62 posts
18 years ago
joost's avatar joost

Helmi, what code are you using - could you c/p it here?

PS: You did enable the extension, right?

       
Helmi_xisnet's avatar
Helmi_xisnet
71 posts
18 years ago
Helmi_xisnet's avatar Helmi_xisnet

Hi joost. Yes i’ve enabled the extension; and it works if its a normal custom field. The code is in the extension file (at the top).

       
UltraBob's avatar
UltraBob
186 posts
18 years ago
UltraBob's avatar UltraBob

Man, I feel like a complete idiot today. Have not been able to get anything going including this extension. More accurately I see it’s effects, but my queries seem not to work correctly. I want to pull entries for which a certain custom field (text input) has something in it. The only entry that has anything in it at the moment has a * in it, but that should be immaterial.

at any rate I’m trying the query like:

{exp:weblog:entries disable="categories|member_data|pagination|trackbacks" rdf="off" weblog="{my_weblog}" orderby="edit_date" pro_en_seek_speaker=".+" max="10"}

I also tried it with “.+” replaced with “/.+/”, “/^.+$/”, “^.+$” nothing works. I either get all of the entries or none of them.

What should I troubleshoot?

       
UltraBob's avatar
UltraBob
186 posts
18 years ago
UltraBob's avatar UltraBob

Finally got it to work with pro_en_seek_speaker=’>’ could find no way to make a regex work.

       
UltraBob's avatar
UltraBob
186 posts
18 years ago
UltraBob's avatar UltraBob

Just a quick note for people coming after. There were a lot of unanswered questions about using segments with this extension. I think most peoples’ problems were with getting it to work in the query part of their tag, and I haven’t needed to try that yet, but it did work in this form for me:

{exp:weblog:entries disable="categories|member_data|pagination|trackbacks" rdf="off" weblog="{my_weblog}" orderby="edit_date" pro_en_seek_{segment_2}=">" max="10"}
       
First 4 5 6 7 8 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.