Reputation: 95
Is there a simple way to add a link back to the main site when using the grappelli admin interface with django?
So when the user goes into the admin interface at
http://myurl/admin/
I'd like a link somewhere back to
http://myurl/
for the main site.
The only way I can see of doing this is to edit the grappelli templates, which feels very hacky for such a simple task.
Upvotes: 3
Views: 1526
Reputation: 5834
You can add a link to the admin title (top left corner) by adding the following to your settings.py:
GRAPPELLI_ADMIN_TITLE = '<a href="/">Homepage</a>'
Upvotes: 1
Reputation: 726
You can use the grappelli dashboard to make a box with custom links on the admin index. After installing the dashboard you can use the LinkList to add links.
class CustomIndexDashboard(Dashboard):
def init_with_context(self, context):
...
self.children.append(modules.LinkList(
_('Links'),
column=2,
children=[
{
'title': u'Homepage',
'url': '/',
'external': False,
},
]
))
Upvotes: 3