5 of 13
5
Custom Fields in {exp:weblog:entries /}
Posted: 26 February 2007 10:48 AM   [ Ignore ]   [ # 73 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1519
Joined  05-15-2004

I believe I tried ‘1’, ‘2’ and ‘5’.

How would you suggest that orderby= and sort= be set for the greater than and lesser than setups? What I find odd is that using lesser than seems to work just fine. I tested that with several different values as the segment, and it worked each time.

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 26 February 2007 10:52 AM   [ Ignore ]   [ # 74 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

We’ll my thinking is that if you say you want numbers less than 5 you’ll get 1,2,3 and 4.  However you only want 4 (I think), so to to get that you’d want the sort to be DESC (which I think is the default).

If you want numbers greater than 5 you’ll get 6,7,8,9 and 10 (assuming 10 is your largest entry).  Limiting this by one gives you 10 (if they’re in DESC order).  Make it ASC order when your choosing a greater than and you’ll get the entry directly following ‘5’.

That was my thinking…

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 26 February 2007 12:26 PM   [ Ignore ]   [ # 75 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1519
Joined  05-15-2004

Ah, okay, got it. Thank you. smile

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 02 March 2007 02:51 PM   [ Ignore ]   [ # 76 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

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!

Profile
 
 
Posted: 02 March 2007 03:12 PM   [ Ignore ]   [ # 77 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

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…

Profile
 
 
Posted: 03 March 2007 07:16 AM   [ Ignore ]   [ # 78 ]  
Grad Student
Avatar
Rank
Total Posts:  96
Joined  06-05-2002

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?

 Signature 

jchunk/media

Profile
 
 
Posted: 03 March 2007 08:15 AM   [ Ignore ]   [ # 79 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12779
Joined  04-29-2002

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

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 03 March 2007 08:32 AM   [ Ignore ]   [ # 80 ]  
Grad Student
Avatar
Rank
Total Posts:  96
Joined  06-05-2002

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?

 Signature 

jchunk/media

Profile
 
 
Posted: 03 March 2007 08:44 AM   [ Ignore ]   [ # 81 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006
joost - 03 March 2007 08:32 AM

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.

Profile
 
 
Posted: 03 March 2007 08:45 AM   [ Ignore ]   [ # 82 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12779
Joined  04-29-2002

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

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 03 March 2007 10:07 AM   [ Ignore ]   [ # 83 ]  
Grad Student
Avatar
Rank
Total Posts:  96
Joined  06-05-2002

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

 Signature 

jchunk/media

Profile
 
 
Posted: 06 March 2007 01:58 AM   [ Ignore ]   [ # 84 ]  
Grad Student
Rank
Total Posts:  76
Joined  02-23-2007

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

Profile
 
 
Posted: 06 March 2007 04:25 AM   [ Ignore ]   [ # 85 ]  
Grad Student
Avatar
Rank
Total Posts:  96
Joined  06-05-2002

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

PS: You did enable the extension, right?

 Signature 

jchunk/media

Profile
 
 
Posted: 06 March 2007 04:40 AM   [ Ignore ]   [ # 86 ]  
Grad Student
Rank
Total Posts:  76
Joined  02-23-2007

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).

Profile
 
 
Posted: 12 March 2007 01:53 AM   [ Ignore ]   [ # 87 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  361
Joined  01-13-2004

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?

 Signature 

———-
1.6.4— Build: 200800808

Profile
 
 
Posted: 12 March 2007 02:09 AM   [ Ignore ]   [ # 88 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  361
Joined  01-13-2004

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

 Signature 

———-
1.6.4— Build: 200800808

Profile
 
 
Posted: 12 March 2007 02:19 AM   [ Ignore ]   [ # 89 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  361
Joined  01-13-2004

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"}

 Signature 

———-
1.6.4— Build: 200800808

Profile
 
 
Posted: 14 March 2007 08:34 AM   [ Ignore ]   [ # 90 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

I can’t get any results when a field has a / in it.  I’m not really up on REGEX, but a quick search shows \ as a reserved character, but not /, so I don’t think it has to do with that?

So for example if I search for “Advertising/Marketing/Public Relations” I get no results (when there are results).

Help?

Profile
 
 
   
5 of 13
5
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66456 Total Logged-in Users: 55
Total Topics: 84831 Total Anonymous Users: 24
Total Replies: 455247 Total Guests: 192
Total Posts: 540078    
Members ( View Memberlist )