2 of 7
2
LG Live Look - Entry Previews in CP Publish/Edit Tab - New Extension!
Posted: 09 October 2008 04:17 PM   [ Ignore ]   [ # 19 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  227
Joined  11-19-2007
james Brown - 09 October 2008 04:10 PM

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.

 Signature 

http://www.bbook.com

Profile
 
 
Posted: 09 October 2008 05:38 PM   [ Ignore ]   [ # 20 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1306
Joined  01-24-2006
Mark Bowen - 09 October 2008 05:22 AM

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.

Mark Bowen - 09 October 2008 05:22 AM

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 :

Mark Bowen - 09 October 2008 05:22 AM

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!

 Signature 

Newism - Newcastle Web Design & Development


NSM Publish Plus - Collaborative workflow and live entry previews
LG Better Meta - SEO Meta & XML Sitemap Generator
LG Polls
LG .htaccess Generator
20+ EE addons

Profile
 
 
Posted: 09 October 2008 05:39 PM   [ Ignore ]   [ # 21 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1306
Joined  01-24-2006
Mark Bowen - 09 October 2008 05:27 AM

I am a pain aren’t I wink

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 wink

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!

 Signature 

Newism - Newcastle Web Design & Development


NSM Publish Plus - Collaborative workflow and live entry previews
LG Better Meta - SEO Meta & XML Sitemap Generator
LG Polls
LG .htaccess Generator
20+ EE addons

Profile
 
 
Posted: 09 October 2008 05:40 PM   [ Ignore ]   [ # 22 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1306
Joined  01-24-2006
iso100 - 09 October 2008 08:15 AM

This looks great! Is it MSM compatible?

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

 Signature 

Newism - Newcastle Web Design & Development


NSM Publish Plus - Collaborative workflow and live entry previews
LG Better Meta - SEO Meta & XML Sitemap Generator
LG Polls
LG .htaccess Generator
20+ EE addons

Profile
 
 
Posted: 09 October 2008 05:45 PM   [ Ignore ]   [ # 23 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1306
Joined  01-24-2006
Deron Sizemore - 09 October 2008 01:42 PM

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

 Signature 

Newism - Newcastle Web Design & Development


NSM Publish Plus - Collaborative workflow and live entry previews
LG Better Meta - SEO Meta & XML Sitemap Generator
LG Polls
LG .htaccess Generator
20+ EE addons

Profile
 
 
Posted: 09 October 2008 05:46 PM   [ Ignore ]   [ # 24 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10831
Joined  04-15-2006

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

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 09 October 2008 05:46 PM   [ Ignore ]   [ # 25 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1306
Joined  01-24-2006
james Brown - 09 October 2008 04:10 PM

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

 Signature 

Newism - Newcastle Web Design & Development


NSM Publish Plus - Collaborative workflow and live entry previews
LG Better Meta - SEO Meta & XML Sitemap Generator
LG Polls
LG .htaccess Generator
20+ EE addons

Profile
 
 
Posted: 09 October 2008 05:51 PM   [ Ignore ]   [ # 26 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  720
Joined  08-31-2005

sweet! can’t wait!!!!

Profile
 
 
Posted: 09 October 2008 07:34 PM   [ Ignore ]   [ # 27 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  660
Joined  03-02-2006

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.

 Signature 

John Faulds - Tyssen Design | Member of EE Pro Network

Profile
 
 
Posted: 09 October 2008 07:51 PM   [ Ignore ]   [ # 28 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1306
Joined  01-24-2006

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

 Signature 

Newism - Newcastle Web Design & Development


NSM Publish Plus - Collaborative workflow and live entry previews
LG Better Meta - SEO Meta & XML Sitemap Generator
LG Polls
LG .htaccess Generator
20+ EE addons

Profile
 
 
Posted: 09 October 2008 07:57 PM   [ Ignore ]   [ # 29 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  660
Joined  03-02-2006

OK cool, will keep that in mind.

 Signature 

John Faulds - Tyssen Design | Member of EE Pro Network

Profile
 
 
Posted: 09 October 2008 08:09 PM   [ Ignore ]   [ # 30 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  855
Joined  11-08-2004

Wow this extension has been a long time coming. I’ve wanted this for awhile. Thank you for developing it. As was mentioned, it really adds value to the publish page.

 Signature 

Member: ExpressionEngine Pro Network: ePlaces Network Services

ePlaces Network Services

Profile
 
 
Posted: 09 October 2008 08:13 PM   [ Ignore ]   [ # 31 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1925
Joined  08-02-2006

Leevi,

I finally got this working. My fault originally. I overlooked the fact that I needed status=“not closed” in the weblog:entries opening tag. Makes sense after I read your tutorial on Newism for the fifth time. Don’t know how I overlooked it the first four times, but anyway, here’s two more bugs that I’ve ran into (or I assume they are bugs). Could be something I’m doing (again).

So, first, as soon as I go to publish a new entry everything looks normal and I have the message “Save this entry to enable Live Look.” So, I fill in all of my fields and then click quick save so that I can view the live look preview. Upon clicking quick save, I get this 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

Aside from getting the error, everything seems to be fine. By that I mean that all I have to do is click the browser back button which takes me back to the entry and then if I click the “edit” tab in the CP, the new entry is there and all I have to do is click on it and I can go back in and view the live look preview and everything works fine from that point on (even the quick save). It’s just that first initial time if I click quick save.

EDIT: Disregard the above. I obviously need to read the WHOLE thread before posting.

The second thing I’ve encountered is because of another extension but I figured I’d mention it to you regardless. Maybe it’s an easy tweak? On our company site, I’ve installed the tab forward extension so that I can select the “show all” tab by default. That way, our users don’t accidentally miss a setting when publishing an entry. When I save the entry and then go back into the entry to view the live look preview, the “show all” tab is selected as normal. The live look preview area is there but it’s just a white box and it does not show the preview until I actually click on the “live look” tab. Not a huge deal, but figured I’d mention it.

Thanks for this extension. It will prove wonderful for our users. I’ve been asked many times over why when they click the “preview” button inside the publish page why it doesn’t look like the live site, so this will be fantastic.

 Signature 

Deron Sizemore
==========
LogoGala | Kentucky Golfing
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 10 October 2008 01:58 AM   [ Ignore ]   [ # 32 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  227
Joined  11-19-2007
Leevi Graham - 09 October 2008 05:46 PM

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 is great. Sorry about my wrong comments. Though I tried the pages module once we never really use it. I was misinformed.

So far the extension is working great on our production server. Everyone is happy with it.

I haven’t been able to get any of the errors others have posted. I may just be luck wink

 Signature 

http://www.bbook.com

Profile
 
 
Posted: 11 October 2008 09:13 AM   [ Ignore ]   [ # 33 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  301
Joined  04-12-2008

Hi Leevi

Just tried it out and installed it on our site, works like a charm, many thanks!

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension
DC Template Manager

Profile
 
 
Posted: 14 October 2008 08:45 AM   [ Ignore ]   [ # 34 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  164
Joined  06-27-2007

Love this extension!

Instead of making a new status, I just setup a separate template that has status=“closed|open”  so that users don’t have to change status to preview it. Also in this separate template, I am previewing what the exceprt looks like on the homepage, and I added warnings at the top in red if an article is not categorized or tagged. Showing them what they haven’t done correctly so easily on the publish page is key. It works like a charm and as really helped my users shape up with their inputs.  Thank you Levi!

 Signature 

Me and Mine
twitter
VisionPoint Marketing

Profile
 
 
Posted: 14 October 2008 04:18 PM   [ Ignore ]   [ # 35 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1306
Joined  01-24-2006
eyevariety - 14 October 2008 08:45 AM

Love this extension!

Instead of making a new status, I just setup a separate template that has status=“closed|open”  so that users don’t have to change status to preview it. Also in this separate template, I am previewing what the exceprt looks like on the homepage, and I added warnings at the top in red if an article is not categorized or tagged. Showing them what they haven’t done correctly so easily on the publish page is key. It works like a charm and as really helped my users shape up with their inputs.  Thank you Levi!

Nice idea, If your willing to make an extra template you can do lots and lots of things. Personally I still prefer the single template option. You could use a single template and still display the warnings using conditional template logic:

- the status was pending
- the user was a super admin / the publisher

 Signature 

Newism - Newcastle Web Design & Development


NSM Publish Plus - Collaborative workflow and live entry previews
LG Better Meta - SEO Meta & XML Sitemap Generator
LG Polls
LG .htaccess Generator
20+ EE addons

Profile
 
 
Posted: 17 October 2008 03:02 PM   [ Ignore ]   [ # 36 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  357
Joined  03-21-2005

Firstly, Leevi, what a wonderful little example of EE magic you’ve pulled off here. Thanks very much for writing it.

Re:

MySQL ERROR:

Error Number: 1064

I have a client who still very much likes to use the built-in CP preview as well as the Live Look, but they run into the error above without fully saving.

Can you estimate when you might find a work around for the need to do a full save?

Keep up the great work, LG. Impressive stuff.

 Signature 

Factory Interactive ~ Web Development

Profile
 
 
   
2 of 7
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120487 Total Logged-in Users: 50
Total Topics: 126559 Total Anonymous Users: 19
Total Replies: 665414 Total Guests: 279
Total Posts: 791973    
Members ( View Memberlist )