On 5/05/2021 6:20 pm, Derek wrote:
> "I'd like to see the sidebar display links to those (currently) dumb
> headings and fetch them to the top."
>
> As I said, you'd need to see if it possible to update Django Suit
> on-the-fly.
>
> Alternately, you could look at making a model-specific template layout
Thanks again for another reference. Most seems familiar but I'll go back
over it.
Wanting a link to a particular part of a page, I figured I needed a name
anchor (<a name="model">) where "model" is the 1:n, n:m related model.
That name anchor needs to be in the location of verbose_name_plural
because that's what Django displays in the Admin just ahead of all the
related records.
I tried that in the admin with, for example ...
verbose_name_plural = mark_safe('<div><a name="links"></div>Useful links')
... and it almost worked! With a few link records in place, the first
one lost its (Show/Hide) button and although I could see its name there
was no way to reveal the record. Same for all the other 1:n and n:m
related records.
It did work as a name anchor by way of bringing up that section to the
top of the browser window.
The urls were in a separate page listing all the sections, not in a
sidebar or drop-down menu as I would really like. I did it that way as a
stepping stone. Thought testing name anchors might be a simple first
step. Glad I didn't start from the other end and discover the
disappearing top record at the finishing post!
Cheers
Mike
> (e.g.
https://realpython.com/customize-django-admin-python/ ) - but to
> make it generic to apply across all pages would require a
> significantly deeper level of admin know-how than I have. Maybe there
> are Django admin plugin projects you could look at for inspiration?
>
> On Monday, 3 May 2021 at 16:44:26 UTC+2 Mike Dewhirst wrote:
>
> Derek
>
> My phone doesn't do interspersed responses well, so my apologies
> for top posting.
>
> The record to which I refer is any one of those in any list page.
>
> After clicking one, if that record has any 1:1, 1:n or n:m related
> records, their /verbose_name_plural/ names will be displayed as
> <
https://groups.google.com/d/msgid/django-users/ec2ed88b-564c-477a-8ebe-067c2d975bf7n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
django-users...@googlegroups.com
> <mailto:
django-users...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/django-users/05ce98b5-2226-471b-96ce-baf0912ce129n%40googlegroups.com
> <
https://groups.google.com/d/msgid/django-users/05ce98b5-2226-471b-96ce-baf0912ce129n%40googlegroups.com?utm_medium=email&utm_source=footer>.