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

Относительный путь в advansed #12

Closed
loveorigami opened this issue Dec 5, 2015 · 2 comments
Closed

Относительный путь в advansed #12

loveorigami opened this issue Dec 5, 2015 · 2 comments

Comments

@loveorigami
Copy link

Использую Yii2 - advanced с двумя доменами.
site.com - фронт
admin.com - админка

Изображения лежать в папке site.com/uploads

Текст редактирую в админке. Вставляю картинку через elfinder (предварительно настроив на относительные пути).

Результат на картинке

2015-12-05_16-28-12

По видимому - для ckeditor должна быть настройка для относительных путей.
Похожее вроде нашел http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.baseHref

Вставляю в настройки editorOptions

'baseHref'=>'http://site.com/uploads'

Но желаемого эффекта не получаю.

Видимо я делаю что-то не так...

Подскажите, как правильно настроить относительные пути в редакторе для разных доменов?

@loveorigami
Copy link
Author

Пробовал также, как тут
http://ckeditor.com/comment/42047#comment-42047

            'baseUrl'=>\Yii::getAlias('@storageUrl').'/',
            'baseDir'=>\Yii::getAlias('@storage').'/'

тоже на вышло

@loveorigami
Copy link
Author

Решил.

'baseHref'=>'http://site.com/uploads'  возвращает только домен http://site.com/

Создал отдельный контроллер 'elfinder-editor'
В нем прописал

 'elfinder-editor' => [
            'class' => '\mihaildev\elfinder\PathController',
            'access' => ['admin'], //глобальный доступ к фаил менеджеру @ - для авторизорованных , ? - для гостей , чтоб открыть всем ['@', '?']
            'disabledCommands' => ['netmount'], //отключение ненужных команд https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#commands
            'root' => [
                'baseUrl' => /uploads
                'basePath' => '@storage', 

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

1 participant