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).

cds invenio fulltext tab

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)…

cds invenio fulltext tab

… but typing the blablabla/files URL by hand will lead to an empty fulltext page. Not cool.

cds invenio fulltext tab

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.

cds invenio delete fulltext 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:

cds invenio delete fulltext tab

The /files url will still be working though.

Related posts:

  1. CDS Invenio: avoid duplicate content on comments and other record tabs
  2. CDS-Invenio: Change SBI process – not referred records, restricted fulltext access
  3. Python: autocomplete names with tab key [solved]
  4. CDS-Invenio: bibrecdocfile
  5. CDS Invenio: Bibformat elements (bfe_*) and language

Leave a Reply

Paypal donate

Please help me keep this blog up by donating.

Por favor, ayúdame a continuar con el blog donando.