haha, sorry I meant to say relationship fields (wow, I needed sleep more than I thought). Like Roger posted a couple pages back.
Posted: 29 June 2007 09:40 PM I am just trying this extension for my old EE 1.5 site. After checking out this thread a bit, it works fine now. IT’s GREAT. But I discovered that when I change a field in the weblog to a “RELATIONSHIP” field, it returns no records. I am sure that I only change a field to “RELATIONSHIP” before that it’s working and returning what I want. Can anyone help ? Or how can I deal with a relationship field where I want to display a value according to the current weblog field ? Roger.
Sheesh, I’ve been messing with this one all day and just cannot seem to get it to work. So I’m in “that” camp. Good thing I’ve worked my way around SQL queries in the past as I’ll probably have to resort to the query module, methinks.
Can we just get an updated EE build where this is native functionality and be done with the 10 page thread and core mods? I mean I know it’s just that easy! Thanks! 😝
I searched around for an existing Feature Request and couldn’t seem to find one, so I put in a new Feature Request for Custom Fields In weblog:entries Tag. I got what I needed on this particular site with some query module usage. Thanks, Mark.
I am having some problems getting the extension to work in a specific scenario (it works fine in another blog, so it is correctly installed at least). Its possible, though, that what I am trying to do isn’t possible, or that I am overlooking something that doesn’t have to do with the extension.
This is what I’ve got:
1)
{exp:weblog:entries weblog="{current_weblog}" 9_id_display=">{segment_3}" limit="1" orderby="9_id_sorting" sort="asc" disable="pagination" dynamic="off"}
What it does is determine which weblog entry to show based on a number provided as segment 3 and which each weblog entry has stored in a custom field. It works fine for 1-8. If the segment is 9, the page comes up with no weblog entry at all. If its 10 or over, it shows the entry with a 2 in the custom field. Why this doesn’t work, I am not quite sure, but I am guessing its down to how things get sorted?
2)
{if segment_3 == "1"}
{exp:weblog:entries weblog="{current_weblog}" limit="1" orderby="9_id_sorting" sort="desc" disable="pagination" dynamic="off"}
{if:else}
{exp:weblog:entries weblog="{current_weblog}" 9_id_display="<{segment_3}" limit="1" orderby="9_id_sorting" sort="desc" disable="pagination" dynamic="off"}
{/if}
A similar setup here, but here its going to the weblog entry where the custom field is one number lower than the number in the segment. The problem here is that no matter what the number in the URL is, I keep getting the link for the site with the highest number.
Again, I am not sure if the custom field extension or something else is the problem, but perhaps you could help me rule it out, at least? 😊
I can get this to work with a simple query like the one’s you’ve listed in your very first post
Example: {exp:weblog:entries custom_field="pattern"}{title}{/exp:weblog:entries} {!– any entry with 'pattern' in the custom field –}
but what if I have several custom fields that are muti-drop-down lists and I want to query with logical AND OR operators. Can your extension work with these operators and what is the correct syntax?
Here’s something I want to do, but I’m not sure how to write it:
{exp:weblog:entries weblog="dailyblog" industries="Telecommunications OR Health Care" AND chapter="Chapter 4" max="3"} <div class=”blog”>
<div class="date2">Posted on {date_of_article format="%M %d, %Y - %h:%i %A"}</div>
{main_text}
</div> <!-- end blog -->
{/exp:weblog:entries}
both of these fields are multi-drop-down. How can I create this kind of logic with this extension? ((industries=”Telecommunications OR Health Care”) AND chapter=”Chapter 4”)
I get the the following error with this line:
{exp:weblog:entries weblog="dailyblog" sql1="(" industries1="Telecommunications" sql2=" OR " industries2="Health Care" sql3=") AND " chapter="Chapter 4: The Power of Play" max="3"}
I tried adding a WHERE in sql1, but that doesn’t fix it. It works fine if I don’t use an AND OR operators or sql. Any ideas? Do you think it would be easier to accomplish this using the query module instead of the extension?
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 ‘OR ) AND d.field_id_11 LIKE ‘h;apter 4: The Power of Play%’ WHERE t.entry_id !’ at line 2
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 ( OR ) AND d.field_id_11 LIKE ‘h;apter 4: The Power of Play%’ WHERE t.entry_id !=” AND t.site_id IN (‘1’) AND t.entry_date < 1189020788 AND (t.expiration_date = 0 || t.expiration_date > 1189020788) AND exp_weblogs.is_user_blog = ‘n’ AND t.weblog_id = ‘2’ AND t.status = ‘open’ ORDER BY t.sticky desc, t.entry_date desc LIMIT 0, 100
Ok, (feeling silly) that was my fault. I gave you the code for an idea I’ve been toying around with, but never implemented. It’s now in version 2.1.8. If you end a custom field with ‘__1’ or ‘__2’ etc. the suffix will get chopped off, so download the latest version and switch your entries tag to the following:
{exp:weblog:entries weblog="dailyblog" sql1="(" industries="Telecommunications" sql2=” OR “ industries__1="Health Care” sql3=") AND “ chapter="Chapter 4: The Power of Play” max="3"}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.