1

I have a few entries which are set to disabled. It seems that the live preview is not working then. It only works when the entry status is enabled.

This seems more like a bug than a feature, right?


Update

I have checked everything again and all conditions stated by Brandon below are met, but now I see that I actually don't use the "entries own url" setting. It's enabled, so I get the live preview button, but I use dynamic routing to create my own url's (because I need to add a category as a segment in the URL).

So that's probably where it goes wrong. I check the last segment of the URI as the slug of the specific entry and set my entry manually by it.

So how do I make live preview work than?

1
  • Include your partial into the template specified in the section's settings. Or redirect.
    – carlcs
    Nov 14, 2015 at 0:56

2 Answers 2

7

Live Preview will be available when the following are true:

  • The section’s “Entries in this section have their own URLs” setting is checked
  • The section’s “Entry Template” setting points to a valid template path
  • The entry has been saved

It doesn’t matter if the entry is enabled or not.

3
  • All of those conditions are met. I'll send in some logs from the dashboard widget. Oct 28, 2015 at 23:05
  • I have checked everything again and all conditions are met, but now I see that I actually don't use the "entries own url" setting. It's enabled, so I get the live preview button, but I use dynamic routing to create my own url's (because I need to add a category as a segment in the URL). So that's probably where it goes wrong. I check the last segment of the URI as the slug of the product and set my entry manually by it. So how do I make live preview work than? Nov 13, 2015 at 21:57
  • @TomDeSmet You should probably create a new thread for that last question. Nov 15, 2015 at 0:21
1

I assume your entry has a category field in it? In your section's settings, use something like this for the format URL:

{myCategoryField.first().slug}/{slug}

No need to roll you own routing, Craft will add the category's slug to your URL and do all of that properly for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.