CDS-Invenio: remove fulltext tab from HTML detailed
If you are using CDS Invenio default template, the HTML detailed view is organized in tabs (Information, References, Citations, Discussion, Usage Statistics, Fulltext).
The last tab shows the fulltexts attatched to a record only if the have been loaded via Bibrecdoc. If you click this tab link you will be redirected to something like http://zaguan.unizar.es/record/4343/files/ (notice the /files trailing part).
If your fulltext consists of an external url -or even a local file which is directly referenced, which are usually files that have not been loaded using a websubmit form- this tab won’t be clickable (the tab will be disabled)…
… but typing the blablabla/files URL by hand will lead to an empty fulltext page. Not cool.
I do not want my users to get used to this /files link structure, so I want to delete this tab and show fulltext links just in the main (Information) tab.
How do you do this? Easy! Open your webstyle_templates.py file:
vi /soft/cds-invenio/lib/python/invenio/webstyle_templates.py
Search for these lines (usually around line 685):
if not enabled: out_tabs += '<li%(class)s><a>%(label)s</a></li>' % \ {'class':css_class, 'label':label} else: out_tabs += '<li%(class)s><a href="%(url)s">%(label)s</a></li>' % \ {'class':css_class, 'url':url, 'label':label}
And change them to:
#if not enabled: if not enabled and label != _('Fulltext'): out_tabs += '<li%(class)s><a>%(label)s</a></li>' % \ {'class':css_class, 'label':label} #else: elif label != _('Fulltext'): out_tabs += '<li%(class)s><a href="%(url)s">%(label)s</a></li>' % \ {'class':css_class, 'url':url, 'label':label}
Save your changes, close the editor and run:
sudo -u apache /soft/cds-invenio/bin/inveniocfg --update-all; /etc/init.d/httpd restart
Now that tab will not be visible, no matter the record has or has not a bibrecdoc fulltext:
The /files url will still be working though.
Related posts:




