-
Notifications
You must be signed in to change notification settings - Fork 584
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
Configurable callback when selecting files in Popup #1510
Comments
@dkoenigroer Quickly looking into this, have you considered to create some glue code such as
django-filer/filer/static/filer/js/addons/popup_handling.js Lines 22 to 28 in 58b017d
Your code might process the returned values and pass them on to CKEditor. |
I think that’s a good idea. Would you like to propose something for the docs?
… Am 22.01.2025 um 12:05 schrieb Dag Königrör ***@***.***>:
Oh i see. Just checked that django-filer also (tries to) already use this function. But i've had a TypeError opener.dismissRelatedImageLookupPopup is not a function.
image.png (view on web) <https://github.com/user-attachments/assets/a23b79d5-f437-4c50-b686-38e42b459123>
Currently i can not find out how to "officially" bring it to work. So i did the following:
In the admin/base_site.html which we already override for some styling extras in the django admin i added:
{% block extrahead %}
<script>
if(document.getElementsByClassName("CMS_CKEditor")) {
const script = document.createElement('script');
script.src = "{% static "filer/js/addons/popup_handling.js" %}";
document.head.appendChild(script);
}
</script>
{% endblock extrahead %}
And now it works 1A!!
So finally the filer does already what it has to do except for the fact that the "opener" window does not contain the popup_handling library. Maybe there is a place we can document it in order to help other users?
—
Reply to this email directly, view it on GitHub <#1510 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEA7CHMLBB3R7TCK3LWSMCL2L53P7AVCNFSM6AAAAABSVUHM22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBWHEZTSNBTGU>.
You are receiving this because you commented.
|
I am sorry for my Post and the deletion after. I answered too quickly. The Thumbnail URL has not been returned. The result was the Image URL which has been already in the form field before trying to change via the filer popup. But i will try to override the callback funtion in the admin-base or change_form in order to use the filer result and give feedback. |
We have a CKEditor and someone configured the browser url settings to
But the Filer expects a FilerField-Target and is only able to return a File-ID.
So a nice feature could be to add a get param with a field name where to put the value in (which is already there but not modifiable) and a field name which value will be returned.
So here we tell the popup tp return the file url instead of the file.id. The _to_field is a placeholder here. i am not sure if the opener winodw knows the field automatically.
The text was updated successfully, but these errors were encountered: