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

LG Live Look - Entry Previews in CP Publish/Edit Tab - New Extension!

Development and Programming

Deron Sizemore's avatar
Deron Sizemore
1,033 posts
16 years ago
Deron Sizemore's avatar Deron Sizemore

Having some trouble getting this to work.

Everything seems to work except for getting my 404 Error page template in the live look preview?

I’ve enabled the display tab for one of my weblogs and entered in the entry URL path as:

/news/article/{url_title}

and all I get is the 404 page.

Also, your documentation link inside of the LG Live Look settings page seems to be broken:

If you enjoyed this addon please bookmark it, write a blog post or link to the documentation!

That documentation link just refreshes the settings page that I’m currently on. Maybe that’s something on my end though?

       
james Brown's avatar
james Brown
492 posts
16 years ago
james Brown's avatar james Brown

It COULD work if the variable for the static page URI was available in the Live Look settings. I believe all this extension is doing is just showing the site in an iframe. So if we were able to use that static page URI as a variable it SHOULD pull up the page in the correct template.

This is all just an educated guess though… Levi?

       
bkuberek's avatar
bkuberek
124 posts
16 years ago
bkuberek's avatar bkuberek
It COULD work if the variable for the static page URI was available in the Live Look settings.

The problem here is that in the extension settings you only have one option. Using the pages module you can set the content to any template under the pages tab. I don’t think this would work but it gave me an idea:

In the Extensions settings, the chosen uri/url will be the default, while in the Live Look tab, there is the option of overwriting the default.

In other words, when you first install the extension, the url/uri input text under the extension settings is the default value for that weblog. While creating or editing an entry, one have a text field above the Live Look iframe. This text input shows the default value for the weblog but you can override it by editing it. It will then be saved with the entry itself, so next time editing the same entry, it already knows the url for the given entry.

This means modifying the extension quite a little. Only Leevi can say how much work that would be and if it is worth it.

       
james Brown's avatar
james Brown
492 posts
16 years ago
james Brown's avatar james Brown

I don’t believe this is accurate.

All you would have to do is set in your live look settings: http://www.domain.com/{page_uri}

Then whatever template you have set and whatever URI will work with Live Look. We just need to have support for the {page_uri} variable in the settings.

       
bkuberek's avatar
bkuberek
124 posts
16 years ago
bkuberek's avatar bkuberek
All you would have to do is set in your live look settings: http://www.domain.com/{page_uri} Then whatever template you have set and whatever URI will work with Live Look. We just need to have support for the {page_uri} variable in the settings.

How could this be implemented? Where is the page uri stored on the Database?

It actually makes sense if {page_uri} is replaced when loading the publish form. That data gets loaded into the Pages tab.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
Hi Leevi, Don’t know if it’s just me or the fact that I am working on a localhost installation but I found that I had to place : http://localhost:8888/lgtest/index.php/lg/index/{url_title} into the settings instead of just /blog/post/{entry_id}/{url_title} as your post here indicated.

Its probably because you are running on localhost with a port number. The url is not modified other than replacing the {ee} variables.

Also do you really need the {entry_id}/{url_title} in the settings as this may cause an error wouldn’t it. Shouldn’t you really just use one or the other (entry_id or url_title) just like you would in a real world example?

The way you setup your url structure is up to you. We use /blog/post/{entry_id}/{url_title} for a couple of reasons.

  1. EE will use the entry_id for the weblog loop. The entry_id never changes which is safer for permalinks.
  2. We add the url_title for SEO benefits.

One other thing I noticed in your blog post was that it says :

2 Set the status to ‘Live Look’ but you had stated above that you had made a Pending status. I think maybe you meant Pending in the instruction line too didn’t you?

My bad… documentation fixed!

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
I am a pain aren’t I 😉 I just went and made a second weblog and went into the extensions settings page and got this error at the very top of the page : Notice: Undefined index: 2 in /Applications/MAMP/htdocs/lgtest/admin/extensions/ext.lg_live_look_ext.php on line 563 Not too sure why that is though? Any thoughts? Best wishes, Mark

Yes you are 😉

You should just be able to save the extension settings for site 2 and the error will go away. I’ll try and figure out what was going on for the next release.

Thanks for the report!

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
This looks great! Is it MSM compatible?

Yeah it should be. Just make sure you save the extension settings for each site.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
Having some trouble getting this to work. Everything seems to work except for getting my 404 Error page template in the live look preview? I’ve enabled the display tab for one of my weblogs and entered in the entry URL path as:
/news/article/{url_title}
and all I get is the 404 page. Also, your documentation link inside of the LG Live Look settings page seems to be broken:
If you enjoyed this addon please bookmark it, write a blog post or link to the documentation!
That documentation link just refreshes the settings page that I’m currently on. Maybe that’s something on my end though?

Hey Deron,

Documentation link has been fixed.

There may be a couple of reasons for your 404 page.

  1. Your templates are not showing pending posts
  2. Your post is published in the future.

LG Live Look only displays an existing template entry. The best bet is to browse diectly to the URL and try and figure out why its not working there rather than in the Live Look tab.

Cheers

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

EDIT Sorry just re-read your post (been a long day!) and saw why you use the entry_id in the URL although I must say I don’t know why anyone would ever change the URL title myself. I always turn that off in the publish form so that clients can’t mess with it

Hi Leevi,

A couple of things if I may? When you say you use both the entry_id and the url_title in your URL’s why exactly do you do that. Is it not good enough just to use the url_title? Just wondering why exactly you do that?

Also when you say save the extension settings for site 2 I take it you meant weblog 2? I only ask as I don’t use the MSM if that is what you meant?

Also if the problem is there because there aren’t any settings for that weblog that exist yet would it be possible for you to maybe check that before the settings page comes up and if any of the weblog settings are empty then perhaps just place something in there automatically and instruct the user to change it? Would that work possibly?

Best wishes,

Mark

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
I don’t believe this is accurate. All you would have to do is set in your live look settings: http://www.domain.com/{page_uri} Then whatever template you have set and whatever URI will work with Live Look. We just need to have support for the {page_uri} variable in the settings.

Hey James,

I’ll add support for this in the next version. Basically if an entry is a page I’ll just use the {page_url} as the Live Look tab value.

That should work a treat

       
james Brown's avatar
james Brown
492 posts
16 years ago
james Brown's avatar james Brown

sweet! can’t wait!!!!

       
Tyssen's avatar
Tyssen
756 posts
16 years ago
Tyssen's avatar Tyssen

Hi Leevi,

When trying to use Quick Save instead of Save on a new entry first, I’m getting the following error:

MySQL ERROR:

Error Number: 1064

Description: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘LIMIT 1’ at line 1

Query: SELECT * FROM exp_weblog_titles WHERE entry_id = LIMIT 1

The entry still gets saved though, and in fact, if I hit the back button and then use the Save button instead, the same entry will get saved twice.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

Hi Tyssen,

You’ll have to save the entry once before using the quicksave. I’m trying to figure out how to get around this issue at the moment as it is a small bump in the workflow.

Cheers

       
Tyssen's avatar
Tyssen
756 posts
16 years ago
Tyssen's avatar Tyssen

OK cool, will keep that in mind.

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