In my Django changelist there are lots of columns that means there is a scrollbar at the bottom of the list. Is it possible to get a scrollbar to appear at the top so I don't need to scroll down
Thanks
Grant
The penny dropped thanks to AlexandreS and this is what I did
I used this plugin: https://github.com/avianey/jqDoubleScroll
I coped the code to my js file: js/admin-help.js
In admin in the model class, I have this
class Media:
js = (
'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', # jquery
'js/admin-help.js', # project static folder
)
Then collectstatic and it looks like it works, as I want too
Thanks
Grant
This is something that you will have to change in your template.
Here is an example of how you can achieve this.
How to override and extend basic Django admin templates?
EDIT: But I am not sure that you can change the template itself.
Related
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
Is there any way to change the Django CMS admin logo? I tried many things to change the logo of Django cms admin but unable to. Can anyone help me?
You could copy, modify and then include this template file in your project in the folder: your-project/templates/cms/toolbar/items
https://github.com/divio/django-cms/blob/develop/cms/templates/cms/toolbar/items/logo.html
You need to keep the css class cms-toolbar-item-logo because the JS binds to that logo and may error without it.
You can then add override the css rule for the icon by changing the content, you may need to rewrite this altogether by setting the content as empty and adding a background image:
.cms-icon-logo:before {
content:"\E02D"
}
want to display my own custom message and link in the top of localhost/admin/module/field before the select fields to change page. I tried with link_display that for displaying each instance obj itself, and i don't want that.
You need to override the change_list.html template for your app, see the documentation.
Money quote for your problem:
For example, if we wanted to add a tool to the change list view for
all the models in an app named my_app, we would copy
contrib/admin/templates/admin/change_list.html to the
templates/admin/my_app/ directory of our project, and make any
necessary changes.
I am beginner to joomla, currently using version 2.5. I have came across a problem with pagination. In my site pagination on all the pages were working well, but suddenly, I don't see any pagination for any page. I don't realized, what setting from admin panel I have changed. I have checked the settings from the Article Manger->options->Shared Options, but all are ok.
Is there any other settings in admin panel to show pagination?
Any help appreciated.
Thanks.
You must seach this in Article Manger->options->"First Tab"
But it can be also placed in the main menu item: Menu->MainMenu->"First item" general settings...
I have realize the problem, when I put <jdoc:include type="module" name="cblogin" /> in my template file, then all the pagination links get disappeared. I have also checked with putting below code -
jimport('joomla.application.module.helper');
$mods = JModuleHelper::getModules('cblogin');
echo JModuleHelper::renderModule($mods[0]);
but, nothing has changed. Is there any other solution to load module into html code?
If you want to add modules to articles, one way is to add a custom position to the article then assign the module to that position. In the article editor add this code
[loadposition myNewPosition]
Then you can assign any module to myNewPosition on the position option. Make sure the module is assigned to all pages.
I have a list of images in my admin area. I would like to add a upp/down button to every field. Clicking on the up field will move the image up in the order of images. So lets say its number 3 on the list and i click on it, it should now move to number 2. and also the same for moving down in the order of the list bly clicking on the down field, button or image.
Any ideas? Please not that I am still new to Django
This snippet will add "up" and "down" links next to every object in admin lists for a given model:
http://www.djangosnippets.org/snippets/998/
I use it in most of my project. I made a little reusable app out of it, by putting it in a separate dictionary (don't forget about the __init__.py file) - # -------- the metaclass portion inside models.py file, # -------- the view inside views.py and # -------- the url config inside urls.py.
You would probably have to create a model and associate it with the images in the admin.
The admin is pretty extensible so if you're familiar with object oriented programming you should be able to overload some of the admin classes. With this in mind you should be able to...
Create a model that has the image/image location and a weight value.
create a custom admin view that utilizes this model.
Resources:
http://www.djangobook.com/en/1.0/chapter17
http://www.djangobook.com/en/beta/chapter18