Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't make it work #39

Closed
t0n1zz opened this issue Nov 7, 2014 · 18 comments
Closed

can't make it work #39

t0n1zz opened this issue Nov 7, 2014 · 18 comments

Comments

@t0n1zz
Copy link

t0n1zz commented Nov 7, 2014

so i tried to integrated it into laravel 4.2 and getting
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException

here is my setup:
tinymce.init({
selector: "textarea",
theme: "modern",
skin: 'light',
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern"
],
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
toolbar2: "print preview media | forecolor backcolor emoticons | fontselect fontsizeselect",
image_advtab: true,
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
],
file_browser_callback : elFinderBrowser
});

function elFinderBrowser (field_name, url, type, win) {
  tinymce.activeEditor.windowManager.open({
    file: 'public_html/elfinder/tinymce',// use an absolute path!
    title: 'elFinder 2.0',
    width: 900,
    height: 450,
    resizable: 'yes'
  }, {
    setUrl: function (url) {
      win.document.getElementById(field_name).value = url;
    }
  });
  return false;
}

and i put my tinymce file in public_html/js

@barryvdh
Copy link
Owner

barryvdh commented Nov 7, 2014

Did you register the routes?

@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

yes,i follow your instruction
Route::get('elfinder/tinymce', 'Barryvdh\Elfinder\ElfinderController@showTinyMCE4');

@barryvdh
Copy link
Owner

barryvdh commented Nov 7, 2014

file: 'public_html/elfinder/tinymce',// use an absolute path!

  1. That is not absolute.
  2. That is not correct, the public_html doesn't belong there.

it's something like url('elfinder/tinymce') or action('Barryvdh\Elfinder\ElfinderController@showTinyMCE4') or `/elfinder/tinymce'

@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

i change it into
tinymce.activeEditor.windowManager.open({
file: 'elfinder/tinymce',// use an absolute path!
title: 'elFinder 2.0',
width: 900,
height: 450,
resizable: 'yes'
}, {
setUrl: function (url) {
win.document.getElementById(field_name).value = url;
}
});
return false;
}

but still getting the same error.... ><

@barryvdh
Copy link
Owner

barryvdh commented Nov 7, 2014

What url is giving a 404?
Did you also register the elfinder and elfinder/connector route?
And you are still not using an absolute path.

@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

what do you mean by absolute path?
Route::group(array('before' => 'auth'), function()
{
\Route::get('elfinder', 'Barryvdh\Elfinder\ElfinderController@showIndex');
\Route::any('elfinder/connector', 'Barryvdh\Elfinder\ElfinderController@showConnector');
});
Route::get('elfinder/tinymce', 'Barryvdh\Elfinder\ElfinderController@showTinyMCE4');

@barryvdh
Copy link
Owner

barryvdh commented Nov 7, 2014

An absolute url, not a relative url.

But what url gives you the 404?

@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

view-source:http://localhost/bkculv/public_html/admins/artikel/1/elfinder/tinymce

still don't understand what you mean by absolute url... can a little example?

@barryvdh
Copy link
Owner

barryvdh commented Nov 7, 2014

If you use the Laravel url helper, is should create an absolute url ('http://domain.com/elfinder/tinymce'). Now you are using relative urls, so the url is appended to the current url. You can use a leading / to make it relative the root, but that doesn't work for you because you have your app in a subfolder.

@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

so what should i insert into file:? i tried file: url('elfinder/tinymce') but when it not even showing file browser modal/windows/dialog

@barryvdh
Copy link
Owner

barryvdh commented Nov 7, 2014

Then you probably haven't configured your paths for you Laravel app right. Sorry I can't really help you with this information, please try to understand how urls/routes work/are generated. And you better use a vhost or something so you don't have to have 'bkculv/public_html/' in your urls.

@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

well i'm newbie in laravel and still learning it...
so maybe atleast show me some example? so i know where to look...

@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

okay, i manage to make it works ahahhaa
../../../elfinder/tinymce
thank you for quick response

but after i tried to use it and upload images and put in into my article, when i want to show it in it parse wrong image file path... instead of http://localhost/bkculv/public_html/files/wallhaven-76098.jpg , it parse http://localhost/files/wallhaven-76098.jpg

what do i miss?

@barryvdh
Copy link
Owner

barryvdh commented Nov 7, 2014

You should try to make a vhost configuration, so that you can use http://bkculv.local instead of http://localhost/bkculv/public_html/
What you have now will only cause more trouble.

@barryvdh barryvdh closed this as completed Nov 7, 2014
@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

but is it will work if i publish my website/project into shared hosting?

@barryvdh
Copy link
Owner

barryvdh commented Nov 7, 2014

On shared hosting you probably also have 1 domain for you app, not a subfolder, right?

@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

yes...
i getting pretty confuse now hahahahha

@t0n1zz
Copy link
Author

t0n1zz commented Nov 7, 2014

okay thank you, after reading about vhost i already get sense what is going on ahhahahaa... so once again thank you for your friendly and fast respond and also for your great component/plugin(it's called that right?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants