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

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

Very glad to hear it. Just to explain it. You are testing for fields that are greater than null. Theoretically, and this is purely speculation, the lesser than sign should have returned only items that didn’t have that field in it.

       
Mikee Bee's avatar
Mikee Bee
179 posts
17 years ago
Mikee Bee's avatar Mikee Bee

Mark, got this working great. Just wondering… will it be possible to implement this for usage on a top level categories page? i.e only display categories that contain entries with the custom field populated?

In my case it is

{exp:weblog:entries weblog="stockists_uk|stockists_europe|stockists_world" limit="9" stockist-paint="Yes"}

The stockist-paint being the custom field

This page is the categories page.

fingers tightly crossed

       
EE lover's avatar
EE lover
50 posts
17 years ago
EE lover's avatar EE lover

Clever extension. Thanks.

       
Adam Khan's avatar
Adam Khan
315 posts
17 years ago
Adam Khan's avatar Adam Khan

Having disable=”member_data” as a parameter seems to break the extension.

       
Rob Quigley's avatar
Rob Quigley
236 posts
17 years ago
Rob Quigley's avatar Rob Quigley

Trying to use this extension with the latest build (Build: 20070708) and can’t seem to make it work. I have this extension on the previous build prior to the 7th and it works fine.

Don’t think I’m doing anything wrong. Double checked weblog name, custom field name, added the two custom hooks in the mod.weblog file. Double checked all of that.

Just seems to be listing all 100 entries with no limit tag being used other than the custom field.

{exp:weblog:entries  weblog="rep"  zip="test" }
{title}


{/exp:weblog:entries}

I’ve tried it with and with out the parameters and all of them work on the previous build.

UPDATE: this extension does not seem to be working for me with the latest build. Can anyone confirm it is working for them?

       
Andrew Biss's avatar
Andrew Biss
3 posts
17 years ago
Andrew Biss's avatar Andrew Biss

I have just setup a new installation using 1.6.0 build 20070708 and I am also having the problem that this extension is no longer working. It was working OK in 1.5.2.

I enabled the comments in the extension and it is being called, but the SQL statement did not look to contain any references to my custom field. I therefore enabled SQL trace in the CP and compared the output from the old and new installations:

Here is an SQL statement from 1.5.2:

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 d.field_id_9 LIKE '&#xRe;commended Link%' 
WHERE t.entry_id !='' 
AND t.entry_date < 1184336493 
AND (t.expiration_date = 0 || t.expiration_date > 1184336493) 
AND exp_weblogs.is_user_blog = 'n' 
AND t.weblog_id = '1' 
AND t.status = 'open' 
ORDER BY t.sticky desc, t.entry_date desc 
LIMIT 0, 5

and here is the same query from 1.6.0:

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
WHERE t.entry_id !='' 
AND t.site_id IN ('1') 
AND t.entry_date < 1184337003 
AND (t.expiration_date = 0 || t.expiration_date > 1184337003) 
AND exp_weblogs.is_user_blog = 'n' 
AND t.weblog_id = '1' 
AND t.status = 'open' 
ORDER BY t.sticky desc, t.entry_date desc 
LIMIT 0, 5

Comparing the output there are two relevant differences

  1. The extra “AND t.site_id IN (‘1’)” which is expected based on the new functionality in EE 1.6.0.

  2. The missing “INNER JOIN”:

INNER JOIN exp_weblog_data AS d ON t.entry_id=d.entry_id AND d.field_id_9 LIKE '&#xRecommended; Link%'

That SQL fragment is the code that the extension should be adding into the SQL, and it is missing in v1.6.0.

This explains why the results are different with v1.6.0, but it does not yet explain why the additional SQL is not being added. Maybe someone with more PHP experience can have a look at the code and see what might be going wrong?

       
Adam George's avatar
Adam George
283 posts
17 years ago
Adam George's avatar Adam George

Same here. Not working in latest build.

       
Adam George's avatar
Adam George
283 posts
17 years ago
Adam George's avatar Adam George

I think this may be the issue…

In the build log for 20070705:

*Fixed a bug in Next / Prev Entry tags involving JOIN precedence changes in MySQL 5 that would cause a query error.

I believe changes were made to:

\system\modules\weblog\mod.weblog.php

Reverting to Build 20070627 allows this extension to work, but it breaks next/prev by category.

Perhaps somebody more capable than I could take a look at mod.weblog.php and see if we can once again have our cake and eat it too??

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

The problem was that the custom fields are now separated out by ‘site’ within EE 1.6, where before they were in a flat list. I’ve updated the extension to take this into account.

       
Adam George's avatar
Adam George
283 posts
17 years ago
Adam George's avatar Adam George

Thank you so much for updating your extension and solving this!

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

@Adam: I’m glad it worked out!

       
Andrew Biss's avatar
Andrew Biss
3 posts
17 years ago
Andrew Biss's avatar Andrew Biss

Mark, Thanks for the update - I can also confirm that this fix works OK with EE 1.6.0.

       
bjsteiger's avatar
bjsteiger
87 posts
17 years ago
bjsteiger's avatar bjsteiger

I am using EE 1.6.0, build 20070726 and it doesn’t seem to be working at all for me. Its like its ignoring it all together.

Thanks bjs

       
Luke Stevens's avatar
Luke Stevens
80 posts
17 years ago
Luke Stevens's avatar Luke Stevens

Did you add the custom hooks? You need to mod an EE file for the extension to work - if you go back a couple of pages you’ll find the updated instructions 😊

       
bjsteiger's avatar
bjsteiger
87 posts
17 years ago
bjsteiger's avatar bjsteiger

Yeah, actually I did try that - the instructions are also in the extension themselves. Let me try it again and see what I can come up with

thanks 😊

       
First 8 9 10 11 12 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.