Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • global.js - web/themes/custom/ou_lib_subtheme/js/global.js

    • Main js file for any additional functionality needed on the site. Will detail contents

    • More detailed breakdown later in this doc.

  • front.js - web/themes/custom/ou_lib_subtheme/js/front.js

    • The js needed for the search box on the homepage

...

  • libcal-events.js - web/modules/custom/libcal_events/js/libcal-events.js

    • Main js for events.

    • More detailed breakdown later in this doc

Controller/PHP

  • LibcalEventsGetEventsController.php - web/modules/custom/libcal_events/src/Controller/LibcalEventsGetEventsController.php

    • Main controller for making the api call and interacting with the ajax call from the js file.

    • More detailed breakdown later in this doc

View rewrites

Some of the view fields required the need to rewrite the results of that field to provide a certain format to the display. This is a breakdown of those rewrites and where they are

E-Resources A-Z view

Page: https://libraries.ou.edu/eresources

Admin: https://libraries.ou.edu/admin/structure/views/view/e_resources/edit/eresources

  • Content: URL

    • Need to fix format of the field_database___uri. This is the URL that the eresource links to and there were some formatting and character issues with this until the following rewrite was added. This fixed version of the URL (field_database_) is what is used in the two rewrites after that are detailed below.

      • {{ field_database___uri|render|striptags|trim|replace({'&': '&'}) }}

  • Content: Title

    • Check if the proxy checkbox was active, if so, add the proxy url to the field_database_ URL. That conditional is used in the rewrite section for this field since the title is what the user clicks on to go to the eresource.

      • Code Block
        {% if field_proxy|trim == 1 %}
        <a class="panel-title" role="button" href="https://login.ezproxy.lib.ou.edu/login?url={{ field_database_ }}" target="_blank" rel="noopener">{{ title }}</a>
        {% else %}
        <a class="panel-title" role="button" href="{{ field_database_ }}" target="_blank" rel="noopener">{{ title }}</a>
        {% endif %}

  • permalink_url (Permalink)

    • This is similar to the Content: Title overwrite. Since we write the permalink out in the eresource listing, we need to add the proxy here as well.

      • Code Block
        {% if field_proxy|trim == 1 %}
        https://login.ezproxy.lib.ou.edu/login?url={{ field_database_ }}
        {% else %}
        {{ field_database_ }}
        {% endif %}

“Getting Started Databases” section on resources by subject pages

Shortened display with only title and description. None of the extra data.

Page Example: https://libraries.ou.edu/resources-subject/engineering

Admin: https://libraries.ou.edu/admin/structure/views/view/e_resources/edit/block_2

  • Content: URL

    • Need to fix format of the field_database___uri. This is the URL that the eresource links to and there were some formatting and character issues with this until the following rewrite was added. This fixed version of the URL (field_database_) is what is used in the two rewrites after that are detailed below.

      • {{ field_database___uri|render|striptags|trim|replace({'&': '&'}) }}

  • Content: Title

    • Check if the proxy checkbox was active, if so, add the proxy url to the field_database_ URL. That conditional is used in the rewrite section for this field since the title is what the user clicks on to go to the eresource.

      • Code Block
        {% if field_proxy|trim == 1 %}
        <a class="panel-title" role="button" href="https://login.ezproxy.lib.ou.edu/login?url={{ field_database_ }}" target="_blank" rel="noopener">{{ title }}</a>
        {% else %}
        <a class="panel-title" role="button" href="{{ field_database_ }}" target="_blank" rel="noopener">{{ title }}</a>
        {% endif %}

E-resources filtered by subject

This is different from view above. It shows all eresources for that subject and is filterable by type and searchable. Also shows full description with the more info section.

Page Example: https://libraries.ou.edu/subjects/african-african-american-studies

Admin: https://libraries.ou.edu/admin/structure/views/view/taxonomy_term/edit/block_1

  • Content: URL

    • Need to fix format of the field_database___uri. This is the URL that the eresource links to and there were some formatting and character issues with this until the following rewrite was added. This fixed version of the URL (field_database_) is what is used in the two rewrites after that are detailed below.

      • {{ field_database___uri|render|striptags|trim|replace({'&': '&'}) }}

  • Content: Title

    • Check if the proxy checkbox was active, if so, add the proxy url to the field_database_ URL. That conditional is used in the rewrite section for this field since the title is what the user clicks on to go to the eresource.

      • Code Block
        {% if field_proxy|trim == 1 %}
        <a class="panel-title" role="button" href="https://login.ezproxy.lib.ou.edu/login?url={{ field_database_ }}" target="_blank" rel="noopener">{{ title }}</a>
        {% else %}
        <a class="panel-title" role="button" href="{{ field_database_ }}" target="_blank" rel="noopener">{{ title }}</a>
        {% endif %}

  • permalink_url (Permalink)

    • This is similar to the Content: Title overwrite. Since we write the permalink out in the eresource listing, we need to add the proxy here as well.

      • Code Block
        {% if field_proxy|trim == 1 %}
        https://login.ezproxy.lib.ou.edu/login?url={{ field_database_ }}
        {% else %}
        {{ field_database_ }}
        {% endif %}