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
1
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
1
  • Home
  • Forums

Custom Fields in {exp:weblog:entries /}

Development and Programming

Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hi there,

Sorry to be a pain with this and not too sure if this has already been dealt with previously in this post but I have just installed this extension on a site running 1.6.0 and have made a field called ‘custom_field_test’ in the weblog I would like to test this out with.

I then made a simple template in the site template group called custom_field_test (Just keeping the names the same for ease of testing sake). In the template I have the following code :

{exp:weblog:entries weblog="default_site" custom_field_test="helicopter"}
{title}

{/exp:weblog:entries}

I have about 20 entries in the default_site weblog and only one of them has the custom_field_test field filled in with the word helicopter so when I visited the template I was hoping to only get that one entry showing up but instead all the entry titles show up. I have tried and tried to get this working or to see where I am going wrong but I just don’t seem to be able to figure it out so thought I might ask on here.

I have deliberately kept the template very very simple as you can see for testing purposes to ensure that nothing else in the page is causing any problems.

Any help with this would be greatly appreciated.

Best wishes,

Mark

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Don’t I feel stupid. 😊

Found the answer!! Found the modifications in the extension that need to be made to the mod.weblog.php file. Applied those and it does just as it says on the tin!! 😊

Absolutely fantastic!! Thanks for the brilliant extension Mark!

Best wishes,

Mark

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
17 years ago
Ryan Blaind's avatar Ryan Blaind

Mark, I had this extension working perfectly on my local development server (MAMP) then when I migrated the ee installation / db to my mediatemple server, I am getting some weird php errors on parsing of my template. Here are the php errors that show up on the page:

Notice: strtotime(): Called with empty time parameter in /home/httpd/vhosts/surinahart.com/httpdocs/system/extensions/ext.custom_fields_in_ee_tags.php on line 203

Notice: strtotime(): Called with empty time parameter in /home/httpd/vhosts/surinahart.com/httpdocs/system/extensions/ext.custom_fields_in_ee_tags.php on line 205

Here is the entries tag in my template:

{exp:weblog:entries weblog="listings" status="not closed" disable="trackbacks|member_data|pagination" rdf="off" openhouse-date=">" dynamic="off"}
            
            <div class="column span-9 append-1">
                <h2><a href="http://{title_permalink=" title="Details">{address}</a></h2>
                Listing Price: <strong>{listing-price}</strong>  –  Availability: <strong>{if availability=="Sold"}<span>Sold</span>{if:else}For Sale{/if}</strong>
                Open House Date: <strong>{openhouse-date format="%l, %M. %d %Y"}</strong>

                Open House Time: <strong>{openhouse-time}</strong>
                {listing-summary}
            </div>

            <div class="column span-5 last">
                <a href="http://{title_permalink=" title="Details">_                {related_entries id="listing-pic"}_                    {medium_url}_                {/related_entries}</a>
                <div class="column span-5">
                    <strong>{address}
{city}, {province}, <span>{postal-code}</span></strong>
                </div>
            </div>

            <hr >

            {if no_results}
            <h2>Sorry!</h2>
            There are currently no Open Houses to display.
            {/if}
            
            {/exp:weblog:entries}

It may have something to do with the version of MySQL? I am not sure, I just know that on my local dev server it was version 5, and on mediatemple it is running 3.23 or something like that. any ideas as to what could be causing this error? thanks in advance!

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
17 years ago
Ryan Blaind's avatar Ryan Blaind

bump?

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
17 years ago
Ryan Blaind's avatar Ryan Blaind

actually when I change my tag to this:

openhouse-date="/.+/"

instead of this, which is how I had it when it was working

openhouse-date=">"

it does not give me the errors… but does not work in limiting the entries, just shows no entries. any help greatly appreciated 😊

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

Ato, I have split this last reply and moved it to the extension’s thread, where it is more appropriate.

       
atiosis's avatar
atiosis
180 posts
17 years ago
atiosis's avatar atiosis

Thanks Derek. I am still having the question though, and I have been reading the whole thread, and noticing that some users are using segmentation as value:

merk="{segment_3}"

My concern is that in my case doesn’t work.. do you have any idea why?!

thanks!

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

@atiosis - It’s kind of a hack to get the dynamic filtering working properly. I’m working on a newer version of the extension that will take this into account, however until then it’s kind of on a user-by-user basis wether it works.

       
atiosis's avatar
atiosis
180 posts
17 years ago
atiosis's avatar atiosis

BTW, I like your extension a lot. It is very useful. .. regarding my issue of the dynamic filtering, what you meant is that it won’t work :-(? How can I hack it to make it work? :red:

Thanks!

       
RJN's avatar
RJN
61 posts
17 years ago
RJN's avatar RJN

this feature is now built into EE 1.6.1 with the search parameter

http://expressionengine.com/docs/modules/weblog/parameters.html#par_search

       
Hop Studios's avatar
Hop Studios
459 posts
17 years ago
Hop Studios's avatar Hop Studios

Well, the new feature in 1.6.1 is wonderful and similar, but it doesn’t allow for > and < comparisons.

I also like Mark’s formatting better, but either one is fine.

TTFN Travis

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

Travis is correct, there are some differences. We would encourage all who do not require numerical comparisons to use the native feature instead of the extension, which I think Mark would himself advocate. I believe there is a feature request already placed for numerical comparisons, as well. We would mainly encourage the use of the native feature because the extension unfortunately requires a hack, and secondarily because the native feature is able to be supported by the support staff. I should note that Mark’s feedback during the 1.6.1 beta was very helpful, and his work here and great attitude are to be commended. Other advantages of the native feature, some of which resulted directly from Mark’s (and our other beta testers) feedback:

  • allows for word boundary searches (looking specifically for ‘cat’ as a word instead of finding ‘categories’ and ‘vocation’ for example)
  • will not conflict with other tag parameters regardless of how your custom fields are named.
  • supports search for (or excluding) empty fields
  • syntax is consistent with other ExpressionEngine tag parameters
       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot
We would encourage all who do not require numerical comparisons to use the native feature instead of the extension, which I think Mark would himself advocate.

I couldn’t agree more Derek. Hopefully in a few revisions there won’t even be a need for this extension and the search: will support a few more operators. Until then, I’d say, as Derek did, use this extension when you absolutely have to have but for everything else go with the built in approach (if for no other reason than you have a support team behind you instead of just me).

       
dardar's avatar
dardar
18 posts
17 years ago
dardar's avatar dardar
@Sam123 - If you’re comfortable with PHP then you could go into the extension and place a `var_dump(‘test’);` at the top of the `modify_sql()` method. Then if you see test you know the extension is running. A few things to check: (1) are you sure sermon_speaker is the exact name of the custom field? (2) Have you tries any other fields? (3) Can you turn on template debugging, is the correct weblog:entries tag shown within the template debugger? (4) Can you turn on SQL debugging, does INNER JOIN appear anywhere within the SQL debugging?

I’ve also did everything I had - added to hooks, enabled, disabled, but it just not works and: INNER JOIN doesn not appear anywhere within the SQL debugging (extension works OK)

       
dardar's avatar
dardar
18 posts
17 years ago
dardar's avatar dardar

Just upgraded EE to the 1.6.1, inserted hooks, and everything works!

Thank you, Mark for your great work.

       
First 12 13 14 15 16

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.