givanz / VvvebJs

Drag and drop page builder library written in vanilla javascript without dependencies or build tools.
https://www.vvveb.com/vvvebjs/editor.html
Apache License 2.0
7.25k stars 1.65k forks source link

builder.js showing error and page is not saving after editing. #181

Open SharifTanvir opened 4 years ago

SharifTanvir commented 4 years ago

When I set up the project I found below error in my browser console:

Uncaught ReferenceError: file is not defined anonymous http://localhost/vvveb/VvvebJs/vvvebjs/libs/builder/builder.js line 34 > Function:3 tmpl http://localhost/vvveb/VvvebJs/vvvebjs/libs/builder/builder.js:51 addPage http://localhost/vvveb/VvvebJs/vvvebjs/libs/builder/builder.js:1902 addPages http://localhost/vvveb/VvvebJs/vvvebjs/libs/builder/builder.js:1908

http://localhost/vvveb/VvvebJs/vvvebjs/editor.php:1110 jQuery 13 l c setTimeout handler*a/< u fireWith fire u fireWith ready _ EventListener.handleEvent* ### And while I click the save boutton I see these messages: Object not found!

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404

localhost
Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.2.33
-> I have changed my editor.html to editor.php -> And my editor.php and save.php are in same directory.
shabeebrizvi commented 4 years ago

There seems to be some minor tweaks required to make this work. It's an amazing tool... thanks to @givanz here is what I did to edit and save html files.

Step 1: Download the code, unzip the folder and move it to server webroot. Rename the folder to vvveb, if you want (you can rename it to anything you want).

Step 2: Open editor.html and change data-vvveb-url="/admin/?module=editor/editor&action=save" to data-vvveb-url="save.php".

Step 3: Open save.php and change sanitizeFileName($_POST['file']); to sanitizeFileName($_POST['fileName']);

Step 4: Save the changes and Voilà!

Hope this helps....Cheers!!! 🥳 👏 🙏

sami196515 commented 4 years ago

hi, I did what you told so now I have my GitHub map with a website template within that map is the map vvveb for the website editor right? So how can I start editing my website index.html template? (I don't know anything about coding...)

@shabeebrizvi

abulka commented 3 years ago

@shabeebrizvi Any tips on also getting the 'New Page' button to work?

I am serving with php -S localhost:8000 and entering / or /demo or demo as the Folder. Entries are created in the Pages area but there is a crash in all cases

builder.js:2191 Uncaught TypeError: Cannot read property 'url' of undefined
    at Object.loadPage (builder.js:2191)

at the code

this.currentPage = name;
var url = this.pages[name]['url'];