Jump to content

PageFrontEdit seems not to work


Guy Verville
 Share

Recommended Posts

I have tried to set the PageFrontEdit module and everything seems to apply.  I see in the code that an id pw-edit-1 has been set but really nothing happens. Double-clicking the text does not show me the editing bar. I have checked that the superuser had the right permissions. What am I missing here?

post-1691-0-87551200-1465744972_thumb.pn

Link to comment
Share on other sites

  • 2 months later...

Hello expert users,

I have not received any thought about my problem here. I have double-checked my settings and everything seems to be operational. However, I don't seen how I can edit in the front-end my text. There is, in fact, no javascript installed in the head to would suggest a editing process while the editing region has been set.

Link to comment
Share on other sites

Can you give a bit more information please:

1. What version of PW is installed?

2. Which option did you use to enable front-end editing: Option A, B, C or D?

3. If using B,C or D please provide the template code you have used to try and enable front-end editing.

4. Any javascript errors in the browser console?

  • Like 2
Link to comment
Share on other sites

Thank you for answering. I have the latest PR 3.0.32, but this prevails since the beginning. I tried Option A and other options. No javascript error. In fact, the javascript doesn't load! I installed a fresh version of PW and it works. Everything is fine in my own site except that the necessary javascript doesn't load...

I have uploaded the files in my templates folder (just the necessary stuff). Perhaps someone will have an idea of what's wrong...

templates.zip

Link to comment
Share on other sites

The PageFrontEdit module renders the necessary markup (JS, etc) immediately before the closing body tag. It uses a simple string replace on the closing body tag to do this, so not much that can go wrong there, provided your template does indeed contain a </body> tag (which yours seems to).

Do you see anything relating to PageFrontEdit in the page source just before the closing body tag?

Of course double-check that you are logged into the back-end as superuser.

 

Link to comment
Share on other sites

Yes, there is a closing body tag.  As I have said, the necessary markup is in place except the scripts... as if the module cannot recognize the way things are settled in my template. I compare with the template files of the fresh install and I cannot see what is wrong with my installation. I thought perhaps that my jQuery script call (before mine) would prevent the module to operate, but I did remove those scripts and nothing happens. I am flabbergasted....

SafariScreenSnapz029.pngSafariScreenSnapz030.png

Link to comment
Share on other sites

This is the code that appends the JS:

https://github.com/ryancramerdesign/ProcessWire/blob/devns/wire/modules/Page/PageFrontEdit/PageFrontEdit.module#L397-L404

All I can suggest is that you debug by editing the module code directly. For example:

1. Log a message to see if function hookPageRender() runs. There are a number of return statements in the function so you can log a number of different messages at different places in the function to check if the function runs right to the end or if some condition is causing it to return early.

2. Dump $out just before it is returned to check that it contains the JS it should (if $out is empty then nothing will be appended).

It will be a process of narrowing down where the problem is occurring.

Link to comment
Share on other sites

Not meaning to hijack for promoting TracyDebugger, but if you grab the very latest version from today, it will let you do

bd($this->renderAssets());

or:

bd($out);

to dump as @Robin S suggested.

Prior to the latest version of Tracy, bd() calls in PW files often didn't work because of the order of when Tracy was loaded.

Hope that helps a little!

  • Like 2
Link to comment
Share on other sites

Thank you so much, everybody. I discovered the culprit which is me... I studied the module and the first this it checks is the presence of the <html> tag... and it was missing! Go figure! After all these years making websites!!!!

I am ashamed... ;-)

 

Thank you again!

  • Like 5
Link to comment
Share on other sites

  • 1 year later...
On 29/08/2016 at 4:06 AM, Guy Verville said:

I am ashamed... ;-)

Let me join you in that shame! Just spent an infuriating 30mins on this. My template?

<?php namespace ProcessWire; ?>

<?= $page->body; ?>

So glad this thread exists!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...