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

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

I’m trying it too. The max is working for me, but pagination isn’t.

Or is it supposed to?

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

I haven’t looked into pagnation. I’ll take a peak now though.

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

Alright, I took the extension to fat camp and came up with a much leaner, faster, more optimized extension. The only condition is that you have to modify your ‘mod.weblog.php’ file to allow the extension hook. You can find instructions for that in the top of the .php file. Other than that pagination, limits, and any other {exp:weblog:entries /} should work now. Grab the EXT at the top of the thread.

       
Melody's avatar
Melody
5 posts
18 years ago
Melody's avatar Melody

Seems to work like a charm. Thank you very much.

Would it be difficult to apply this also to exp:weblog:prev_entry and exp:weblog:next_entry?

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

hum, as a workaround for now you might want to try replacing exp:weblog:prev_entry and exp:weblog:next_entry with normal exp:weblog:entries tags switching the sort and limiting by 1? I’m not sure just how well that will work, but it’s alternative.

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

I can’t seem to make this limit at all. I’ve tried a few different combos but it just outputs every entry in the weblog. Am I doing anything noticably wrong below?

{exp:weblog:entries  weblog="homepage_top_story"  test_field="one"}

    {title}



{/exp:weblog:entries}

I assume if I have an input field or drop down field (one or the other) that has “one” in it, that all those entries will show up but those without that text will not. I would use this right now if it worked for me.

Any help is appreciated. Thanks!

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

You’ll want to make sure you update your weblog files as described here: http://ellislab.com/forums/viewthread/38371/P18/#187855 and in the top of the extension. Have you done that?

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

No, sorry, I didn’t. Cool, I will make sure to do that now. Thanks!!

=== Update: Yep - that did the trick!

       
FrankJohnson's avatar
FrankJohnson
150 posts
18 years ago
FrankJohnson's avatar FrankJohnson
The only condition is that you have to modify your ‘mod.weblog.php’ file to allow the extension hook. You can find instructions for that in the top of the .php file.

Hi. I’m trying to get this extension to work. I’m encountering the same problem that Rob Q was encountering, and I’m 99% certain the reason is that I haven’t modified the mod.weblog.php file. But I can’t for the life of me find the instructions for doing that in the top of the .php file.

Can someone point me in the right direction?

Thanks, Frank

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

If you open the extension in an HTML editor it has this instruction for modifying the mod.weblog.php file which itself is found in System > Modules > mod.weblog.php.

So in mod.weblog.php search for

($this->paginate == TRUE)

– I believe there is more than one instance but it should be around line 2137

FIND THIS:
                // ----------------------------------------
                //  Do we need pagination?
                // ----------------------------------------
                // We'll run the query to find out
                if ($this->paginate == TRUE)
                
            INSERT THIS RIGHT BEFORE THAT LINE:
                // -------------------------------------------
                // 'build_sql_query' hook.
                //  - Rewrite, or add to the sql query
                //
                    global $EXT;
                    if (isset($EXT->extensions['build_sql_query']))
                    {
                        $sql = $EXT->call_extension('build_sql_query', $sql, $this);
                        if ($EXT->end_script === TRUE) return;
                    }
                //
                // -------------------------------------------
       
FrankJohnson's avatar
FrankJohnson
150 posts
18 years ago
FrankJohnson's avatar FrankJohnson

Okay. I see now. That did the trick.

Thanks Rob Q, for the speedy answer (and on New Year’s Day - didn’t expect such a quick response)!

Frank

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

Mark -

What a great extension - especially for those of us with little query knowledge. Thank you!!

I just ran into a situation where I need to include two different conditions like this:

{exp:weblog:entries weblog="events" show_future_entries="yes" limit="3" sort="asc" efront="=Yes" esloc="Delaware|Virginia"}
<h2>title</h2>
{body}
{/exp:weblog:entries}

But as I quickly found out - it does not work.

Can I have two conditions (notice the last two conditions: efront and esloc), but then look closer at esloc - I tried to include two different settings. Is this possible? If not I would love to add this as a feature request.

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

Mark, Thanks so much for taking up the Extensions challenge and bringing us functionality we long for such as in this extension. Count me as another grateful user of your work.

Must. Study. Extensions.

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

I am a little uncertain about which version is the most recent of this extension. This thread lists 2.0.4, but Mark’s website lists it as 2.1.2. 😊

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

Any chance of getting this to work with relationship fields?

       
1 2 3 4 5 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.