Coder Social home page Coder Social logo

Comments (7)

caa avatar caa commented on July 19, 2024

I just started using https://github.com/jose-lpa/django-filebrowser-no-grappelli and his branch looks good except for the "select file" issue. I just wasted like ten hours on this trying to get this working right with TinyMCE.

If you put this in your project's settings file, you'll be able to link to all the file types listed in filebrowser/settings.py EXTENSIONS dictionary. The image, file, and media keys in the following dictionary are used when you click on the image, link, and media icons in TinyMCE's toolbar respectively.

screenshot 2013-10-26 00 27 30

The following settings are for django-tinymce.

FILEBROWSER_SELECT_FORMATS = {
    # image is used when you click on "Insert/edit image" icon
    'image': ['Image'],
    # file is used when you click on "Insert/edit link" icon
    'file': ['Folder','Image','Video','Document','Audio','Code'],
    # media is probably used when you click on "Insert/edit media" icon
    'media': ['Video','Audio'],
}

FYI These are the extensions in filebrowser's settings.py, which you can override.

EXTENSIONS = getattr(settings, "FILEBROWSER_EXTENSIONS", {
    'Folder': [''],
    'Image': ['.jpg','.jpeg','.gif','.png','.tif','.tiff'],
    'Video': ['.mov','.wmv','.mpeg','.mpg','.avi','.rm'],
    'Document': ['.pdf','.doc','.rtf','.txt','.xls','.csv'],
    'Audio': ['.mp3','.mp4','.wav','.aiff','.midi','.m4p'],
    'Code': ['.html','.py','.js','.css']
})

from django-filebrowser-no-grappelli.

gauravnagia avatar gauravnagia commented on July 19, 2024

Hi,

I am facing the same problem (not seeing the Select Buttons at all). It seems like django-filebrowser-no-grapelli is working fine, but I am making some mistakes in integrating with django-tinymce.
I added the 2 variables in settings.py of filebrowser-
URL_TINYMCE = getattr(settings, "FILEBROWSER_URL_TINYMCE", DEFAULT_URL_TINYMCE)
PATH_TINYMCE = getattr(settings, "FILEBROWSER_PATH_TINYMCE", DEFAULT_PATH_TINYMCE)

Please suggest what extra settings are required.
I installed the below using pip and used with admin site-
Django==1.5.4
django-tinymce==1.5.2
Pillow==2.3.0
django-filebrowser-no-grappelli==3.1.1

I am new to django frameworks, so would be grateful if you could elaborate the further steps required.
Thanks in advance.

Regards,
Gaurav

from django-filebrowser-no-grappelli.

caa avatar caa commented on July 19, 2024

Try using this branch of django-tinymce https://github.com/aljosa/django-tinymce. django-tinymce 1.5.2 is really old. You should use maintained versions of both django-tinymce & django-filebrowser. You shouldn't have to monkey with any apps' settings.py file.

Wardi's branch of django-filebrowser also has issues. He's not merging the fixes that other people have completed. I recommend this branch https://github.com/jose-lpa/django-filebrowser-no-grappelli.

Make sure you have the following in your project's settings.py file (not filebrowser's).

FILEBROWSER_SELECT_FORMATS = {
    # image is used when you click on "Insert/edit image" icon
    'image': ['Image'],
    # file is used when you click on "Insert/edit link" icon
    'file': ['Folder','Image','Video','Document','Audio','Code'],
    # media is probably used when you click on "Insert/edit media" icon
    'media': ['Video','Audio'],
}

I hope you can get it working soon. Good luck.

from django-filebrowser-no-grappelli.

gauravnagia avatar gauravnagia commented on July 19, 2024

Hi,

I am still facing issues in getting it working. Here is my new Requirements file-
django==1.5.1
Pillow==2.3.0
https://github.com/jose-lpa/django-filebrowser-no-grappelli/zipball/master#egg=filebrowser
https://github.com/aljosa/django-tinymce/zipball/master#egg=tinymce

I reverted all the changes except adding 'FILEBROWSER_SELECT_FORMATS' in settings.py file of my project.

But still getting the same result, Not seeing the select buttons. for any of the filetype.
qa_viewer

Please suggest if I am missing something.
Regards,
Gaurav

from django-filebrowser-no-grappelli.

wardi avatar wardi commented on July 19, 2024

@caa thank you for pointing that out. I've merged jose-lpa's branch

from django-filebrowser-no-grappelli.

caa avatar caa commented on July 19, 2024

@wardi that's great news! Thank you for having a branch of django-filebrowser. It helped me out a lot.

@gauravnagia I noticed there isn't a column for selections. It might be because nothing is selectable. Have you overridden any of filebrowser's templates by any chance?

Here's my other settings in settings.py. Sorry I forgot to include them. PROJECT_PATH is your full project path. This config assumes the static & media folders are in your project directory. You'll probably have to change the paths to suit your project. Hope this helps. I'm using Django 1.6 here.

MEDIA_URL = '/media/'
STATIC_URL = '/static/'

# Django Tinymce app settings
TINYMCE_JS_URL = '/static/tiny_mce/tiny_mce.js'
TINYMCE_JS_ROOT = PROJECT_PATH + 'tiny_mce'
TINYMCE_DEFAULT_CONFIG = {
    'theme' : "advanced",
    'plugins' : "inlinepopups, paste, media, table, fullscreen",
    # Fix Url, Js behaviors
    'convert_urls' : False,
    'relative_urls' : False,
    'valid_elements' : "*[*]",
    # Theme options
    'theme_advanced_buttons1_add' : "|,fullscreen",
    'theme_advanced_buttons3_add' : "media,|,pastetext,pasteword,|,tablecontrols",
    'theme_advanced_toolbar_location' : "top",
    'theme_advanced_toolbar_align' : "left",
    'theme_advanced_statusbar_location' : "bottom",
    'theme_advanced_resizing' : True,
    # STYLING
    'width' : '85%', 'height' : '500px',
}

FILEBROWSER_DIRECTORY = ''
FILEBROWSER_URL_FILEBROWSER_MEDIA = '/static/filebrowser/'
FILEBROWSER_PATH_FILEBROWSER_MEDIA =  PROJECT_PATH + FILEBROWSER_URL_FILEBROWSER_MEDIA
FILEBROWSER_DEFAULT_SORTING_BY = 'filename_lower'
FILEBROWSER_DEFAULT_SORTING_ORDER = 'asc'
FILEBROWSER_MAX_UPLOAD_SIZE = 1024*1024*100

Here's a screenshot. My settings make even folders selectable.
screenshot 2014-02-19 15 25 36

If this doesn't work maybe we can do a Google Hangout, Skype or Facetime.

from django-filebrowser-no-grappelli.

gauravnagia avatar gauravnagia commented on July 19, 2024

Hi,
Sorry for bothering you again. :)
I changed the settings exactly how you mentioned but I am still not able to see the 'Select' Buttons. Also I am not overriding any of filebrowser's template. Could you please contact me on my email id ([email protected])?

from django-filebrowser-no-grappelli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.