Django CKeditor rendering weirdly only in one place - django

I'm using django-ckeditor-4.4.4, It's configured properly as far as I know and the widget works great in the admin panel and in an upload page I created. I know created an edit page for the same model and the ckeditor widget is rendering weridly and not responsive at all.
here it is rendered fine in the upload page I created:
it works fine and dandy
here it is in the edit page for the exact same Model:
It looks a bit different, the buttons don't work.
I'm seriously completely confused.
I don't know how to fix this, any help at all would be amazing

Fixed.. apparently ck-editor freaks if you accidentally apply any styling to a div that is wrapping it.
remove all styling, problem solved.

Related

How to enable horizontal scrolling in Django Admin list view?

I really like the Django Admin list view. I would like to show ~30 fields of one table in the list, however my issue is that horizontal scroll bar is not visible in the list view even though data overflows right border. How can I enable scrolling?
This seems to be an open bug in Django: https://code.djangoproject.com/ticket/26066
If you are fine with the problems stated in that issue you could just add some css code:
#changelist-form .results {
/*overflow-x: auto;*/
}
But if you have an even better solution you could always overwrite the default templates quite easily. Just add a change_list.html and add your custom code there. See the original change_list.html for reference:
I found this post/method worked nicely for me. It applied a scroll bar to the table view only thus making it easy to navigate:
https://til.simonwillison.net/django/django-admin-horizontal-scroll

Adding non-CMS (Django) page to Wagtail menu

I may not be understanding something obvious, but I'm struggling to add a (top-level) menu item to my Wagtail based menu that hooks to a page rendered by an included app that doesn't know about Wagtail. Ideally, it is just a normal Django TemplateView with standard urlconf, though I may need to add some custom code.
If I use the custom URL in the menu editor, I get a not found from Wagtails core.serve. I've looked at snippets, wagtail hooks, RoutablePageMixin, and the custom URL in the menu editor and none seem like it accomplishes what I'm trying to do.
It may well be that I'm simply misunderstanding the docs, but is there a simple example of someone doing this? The closest I've found so far is https://www.caktusgroup.com/blog/2016/02/15/wagtail-2-steps-adding-pages-outside-cms/. I've also searched https://docs.wagtail.io/en/v2.4/advanced_topics/third_party_tutorials.html to now avail. Any guidance appreciated.
Thx,
--Don
Hope this is useful, but it seems that my problem was not the mixing of Wagtail and non-Wagtail items - it was in my URLConf - Wagtail.core.serve occurred before the Django url I was trying to reach and was trying to respond. Once I reordered the URLConf appropriately, I am getting the view as I wanted.
Sigh...

django-tinymce modern theme

I'm having issues getting the modern theme to work with django-tinymce. Both the simple and the advanced themes render correctly, but when I switch to the modern theme nothing renders and I get a 404 error for /static/tiny_mce/themes/modern/editor_template.js in the console
I am attempting to do all of this in the django admin. The error is coming from /static/tiny_mce/tiny_mce.js which is interesting because I don't have anything installed in that directory. I'm using /static/js/tinymce as my TINYMCE_JS_ROOT in settings.py. When switching between simple and advanced theme, everything works correctly.
I've tried to copy a version of editor_template.js in the exact location it's looking, but I still get the 404. It's like it wipes out /static/tiny_mce if it exists and replaces it with something, but I can't figure out how/where it's getting that from.
I'm using an install of TinyMCE 4.1.3 from http://www.tinymce.com/download/download.php and django 1.6.5
I've been struggling with TinyMCE recently, as well. I'm using TinyMCE v4 and Django 1.6. I went down the django-tinymce/django-flatpages-tinymce route because I had these working on another project. Some how it wasn't working for this new project. I did some research and decided to just go straight TinyMCE, no Django applications (eg, no django-tinymce or django-flatpages-tinymce).
This method cuts down on all configuration in Django, and it can be completely handled within the tinymce.init call. I found this much easier than dealing with Django's settings files, overriding models, etc. Just simply find the template you want TinyMCE to spice up and add the init call there.
The example here for full featured example really helped me:
http://www.tinymce.com/tryit/full.php
This use the modern theme...
I simply added this to whichever change_form.html template for whatever model I was needing the rich editor. For instance for flatpages:
admin/flatpages/flatpage/change_form.html
Or custom model in app:
admin/custom_app/model_name/change_form.html
I know this is exactly an answer to your question, but I think it's worth thinking about and might help you ultimately get what you need.
Also, I should note, it looks like only modern theme is available for TinyMCE v4:
http://www.tinymce.com/wiki.php/Tutorial:Migration_guide_from_3.x

Mura tag/page content rendered backwards

hi guys,
I'm having bit of an issue with a Mura tag, I don't really use a lot of them but I have one in a page with some content underneath it but no matter what I do it renders below any content entered beneath it.
Is this normal? Is there a work around?
No, it's not normal. The Mura tag works similar to cfinclude. Output appears where you include it. I suspect that you have rather a HTML/CSS problem, than a Mura problem. Check your HTML source to see where the output actually shows up.

Facebook Open Graph OG: Meta Tags - Works only sometimes?

I have a like button on my site, i have defined all the og: meta tags and its works for most of most pages, but doesnt for 2 other pages. Its using a template so its exactly the same code, how can it work for some but not all pages?
For the pages it doesnt work, it doesnt pick up the title, image, link or description, basically any of the meta tags information.
Working like button....
http://www.imoffonholiday.com/holiday.php?id=des_home&destination=faliraki
Not working Like button
http://www.imoffonholiday.com/holiday.php?id=des_home&destination=ayianapa
Any ideas?
One usual problem is caching. If you were testing and at some point had the wrong data in the metatags facebook will cache that info.
One simple wat to test if it is a caching issue is to add a random param at the end of the URL.
so www.yourpage.com/index.php?cacheBust=1
Running the Facebook Debugger often clears those kind of things up. It appears to refresh the FB cache when you do.