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

Having trouble with Live Preview

Development and Programming

User TVlTLoPz's avatar
User TVlTLoPz
6 posts
2 weeks ago
User TVlTLoPz's avatar User TVlTLoPz

Hey all! I seem to need some help. Possibly related to this bugfix PR I made: <https://github.com/ExpressionEngine/ExpressionEngine/pull/5120> I’m excited because the PR just got accepted today 🙂 but even if I patch my local site with the fix, I now have Live Preview showing a 404 page in the preview pane, and only for the channel in question. I’m not sure how to go about debugging this issue. Will add some details in a thread.

       
User TVlTLoPz's avatar
User TVlTLoPz
6 posts
2 weeks ago
User TVlTLoPz's avatar User TVlTLoPz

I have a News channel and an Events channel. These are both configured as Listing channels within Structure. Previews for the News are working just fine but not for Events. I got TypeError before the patch, but once I apply it, the preview pane is showing a 404.

For the Events channel: some of the client’s events have sub-pages within them. To get that working, I am using Freebie. I wonder if that’s what’s breaking the live preview?

       
User TVlTLoPz's avatar
User TVlTLoPz
6 posts
2 weeks ago
User TVlTLoPz's avatar User TVlTLoPz

For the News channel, the “Preview URL” field is blank and it works just fine. For Events though, I get 404s whether I leave it blank or configure it to events/{url_title}

       
Rob Allen's avatar
Rob Allen
3,108 posts
2 weeks ago
Rob Allen's avatar Rob Allen

Have you got any custom statuses in use?

If you have you’ll have to add them to the channel entries tag in your template. Here’s one I made earlier that lets preview see entries that are closed or “Draft” status using the status parameter and the is_live_preview_request variable:

status="open{if is_live_preview_request}|Draft|closed{/if}"
       
User TVlTLoPz's avatar
User TVlTLoPz
6 posts
2 weeks ago
User TVlTLoPz's avatar User TVlTLoPz

I do have one custom status, but it isn’t assigned to this channel. I could still try that maybe!

       
User TVlTLoPz's avatar
User TVlTLoPz
6 posts
2 weeks ago
User TVlTLoPz's avatar User TVlTLoPz

Okay, I think I figured it out. Seems like a bug in Freebie.

My template relies on what’s in freebie_1 and freebie_2 but those variables never get set by freebie while in live preview.

For now I’ve found a workaround by using conditional logic. Thanks for the suggestions.

       
User TVlTLoPz's avatar
User TVlTLoPz
6 posts
2 weeks ago
User TVlTLoPz's avatar User TVlTLoPz

That status variable hint is incredibly helpful. Didn’t know there was a live preview variable I could check. You helped me solve another problem that I hadn’t even realized I was having, haha. Thank you @roballen.

       

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.