rdrew 1 year ago
parent
commit
f166759a96
  1. 0
      css/sass/components/_megamenu.scss
  2. 1
      roblib_2023.info.yml
  3. 11
      roblib_2023.theme
  4. 222
      templates/block/block--block-content--72a4ea11-76f7-4d80-b914-1386b250fb6b.html.twig
  5. 0
      templates/components/accordion_nodes/field.html.twig.bk
  6. 2
      templates/components/block--roblib-2023-site-branding.html.twig
  7. 82
      templates/components/field--node--field-proxied-link--database.html.twig
  8. 4
      templates/components/lp-news-blocks/views-view-fields--landing_page_news_blocks.html.twig
  9. 0
      templates/components/menu--main.html.twig.old
  10. 31
      templates/components/region--header.html.twig
  11. 64
      templates/components/search-facets/facets-item-list.html.twig
  12. 28
      templates/components/search-facets/facets-result-item.html.twig
  13. 64
      templates/content/node--5706.html.twig

0
css/sass/components/_megamenu.scss

1
roblib_2023.info.yml

@ -21,6 +21,7 @@ regions:
footer: 'Footer' footer: 'Footer'
subfooter: 'Subfooter' subfooter: 'Subfooter'
breadcrumb: 'Breadcrumb' breadcrumb: 'Breadcrumb'
hidden: 'Hidden'
page_top: 'Page top' page_top: 'Page top'
page_bottom: 'Page bottom' page_bottom: 'Page bottom'
generator: 'starterkit_theme:10.0.1' generator: 'starterkit_theme:10.0.1'

11
roblib_2023.theme

@ -19,6 +19,17 @@ function roblib_2023_preprocess_image_widget(array &$variables) {
unset($data['preview']); unset($data['preview']);
} }
} }
function roblib_2023_field__field_proxied_link__database($variables) {
// the name of the function came from the devel themer tool after 1st putting dpm() in themename_field()
// dpm($variables);
// this dumps the vars using the devel mod. use it to target the varibles printed below.
$output = '';
$output = '<a href="http://proxy.library.upei.ca/login?url=' . $variables['items'][0]['#element']['display_url'] . '">' . $variables['items'][0]['#element']['title'] . '</a>';
return $output;
}
function roblib_2023_preprocess_html(&$variables) { function roblib_2023_preprocess_html(&$variables) {

222
templates/block/block--block-content--72a4ea11-76f7-4d80-b914-1386b250fb6b.html.twig

@ -0,0 +1,222 @@
<style>
.accordion {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
transition: 0.4s;
}
.active, .accordion:hover {
background-color: #ccc;
}
.panel {
padding: 0 18px;
background-color: white;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
</style>
<p>
Hot topics this week: <a href="/wireless">Wireless configuration;</a>&nbsp;<a href="/printing">Printing</a>
</p>
<button class="accordion">Books</button>
<div class="panel">
<ul>
<li>
<a href="/books">Find books on a topic</a> -&nbsp;see also the <a href="/sg">subject guide</a> for your topic
</li>
<li>
<a href="/books/find">Find books on the shelves</a> (also video:&nbsp;<a href="http://resources.library.upei.ca/libtours/LearningObjects/RM-Call_Numbers/index.html">how to use a Call Number</a>)
</li>
<li>
<a href="/borrowing-renewing-returning-library-materials">Checkout and renewal of print books</a>
</li>
<li>
<a href="/ebooks">Ebooks</a>&nbsp;
</li>
</ul>
</div>
<button class="accordion">Articles</button>
<div class="panel">
<ul>
<li>
<a href="/articles">Find articles on a topic</a> - see also the <a href="/sg">subject guide</a> for your topic
</li>
<li>
<a href="/peer-reviewed-articles-how-find">Peer-reviewed articles</a>
</li>
<li>
<a href="/howto/citation">Reading an article citation</a>&nbsp;
</li>
</ul>
</div>
<button class="accordion">Study Spaces</button>
<div class="panel">
<ul>
<li>
<a href="/floorplans">Floor plans</a>
</li>
<li>
<a href="/quiet">Quiet</a>
</li>
<li>
<a href="/study_rooms">Group</a>
</li>
</ul>
</div>
<button class="accordion">Technology</button>
<div class="panel">
<ul>
<li>
<a href="/printing">Printing</a>&nbsp;
</li>
<li>
<a href="/scan">Scanning</a>&nbsp;
</li>
<li>
<a href="/computers">Workstations</a>&nbsp;
</li>
<li>
<a href="/laptop">Laptops</a> you can check out
</li>
<li>
Your laptop in the library:
<ul>
<li>
<a href="/wireless">wireless network</a>
</li>
<li>
<a href="/laptop/print">laptop printing</a>
</li>
</ul>
</li>
<li>
<a href="/collaboratory">Multimedia - DVDs, videos, etc</a>.
</li>
<li>
<a href="/3dprinting">3D printing</a>
</li>
</ul>
</div>
<button class="accordion">Getting Help</button>
<div class="panel">
<ul>
<li>
<a href="/get_help">4 Ways to get help</a>
</li>
<li>
<a href="/askus">AskUs online chat</a>
</li>
<li>
Appointments with <a href="/librarians">subject librarians</a>
</li>
<li>
<a href="/ill">Get material not available at the Library</a>
</li>
</ul>
</div>
<button class="accordion">Research Tools and Tips</button>
<div class="panel">
<ul>
<li>
<a href="/onesearch_about">OneSearch</a>&nbsp;- the mega search for books, articles, and more
</li>
<li>
<a href="/sg">Subject guides</a>&nbsp;- tips for your discipline
</li>
<li>
<a href="/refworks">RefWorks</a>&nbsp;- how to manage your bibliography citations
</li>
<li>
<a href="/gscholar">Google Scholar</a>
</li>
</ul>
</div>
<button class="accordion">About the Library</button>
<div class="panel">
<ul>
<li>
<a href="/libraryhistory">Mission/History</a>&nbsp;
</li>
<li>
<a href="/people">Staff</a>
</li>
<li>
<a href="/units">Organization</a>&nbsp;
</li>
<li>
<a href="/visiting">Visiting from off-campus</a>
</li>
</ul>
</div>
<button class="accordion">Other Info</button>
<div class="panel">
<ul>
<li>
<a href="/reserves">Reserves (for students)</a>&nbsp;
</li>
<li>
<a href="/faculty">Faculty</a>
</li>
<li>
<a href="/alumni/community">Alumni</a>&nbsp;
</li>
<li>
How to find more information on this website
<ul>
<li>
Use <a href="/all-search">All Search</a> to keyword search (e.g. "lost and found")
</li>
<li>
Use the <a href="/site-index">Site Index</a> to browse all page titles (excludes Databases and Reserves)
</li>
<li>
Use the list of links at the "footer" of every page including this one
</li>
</ul>
</li>
</ul>
</div>
<script>
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
}
</script>
{#<div{{ attributes.addClass(classes) }}>#}
{#{{ title_prefix }}#}
{#{% if label %}#}
{#<h3{{ title_attributes }}>{{ label }}</h3>#}
{#{% endif %}#}
{#{{ title_suffix }}#}
{#{% block content %}#}
{#{{ content }}#}
{#{% endblock %}#}
{#</div>#}

0
templates/components/accordion_nodes/field.html.twig → templates/components/accordion_nodes/field.html.twig.bk

2
templates/components/block--roblib-2023-site-branding.html.twig

@ -17,7 +17,7 @@
<ul class="branding menu"> <ul class="branding menu">
{% if site_logo %} {% if site_logo %}
<li> <li>
<a href="{{ path('<front>') }}" rel="home" class="site-logo"> <a href="https://upei.ca" rel="home" class="site-logo">
<img src="{{ site_logo }}" alt="{{ 'Home'|t }}" /> <img src="{{ site_logo }}" alt="{{ 'Home'|t }}" />
</a> </a>
</li> </li>

82
templates/components/field--node--field-proxied-link--database.html.twig

@ -0,0 +1,82 @@
{#
/**
* @file
* Theme override for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
* theming for a subset of fields using
* @link themeable Theme hook suggestions. @endlink For example,
* here are some theme hook suggestions that can be used for a field_foo field
* on an article node type:
* - field--node--field-foo--article.html.twig
* - field--node--field-foo.html.twig
* - field--node--article.html.twig
* - field--field-foo.html.twig
* - field--text-with-summary.html.twig
* - field.html.twig
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
*
* @see template_preprocess_field()
*/
#}
{%
set classes = [
'field',
'field--name-' ~ field_name|clean_class,
'field--type-' ~ field_type|clean_class,
'field--label-' ~ label_display,
label_display == 'inline' ? 'clearfix',
]
%}
{%
set title_classes = [
'field__label',
label_display == 'visually_hidden' ? 'visually-hidden',
]
%}
{#{{ kint(items)}}#}
{% if label_hidden %}
{% if multiple %}
<div{{ attributes.addClass(classes, 'field__items') }}>
{% for item in items %}
<div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
{% endfor %}
</div>
{% else %}
{% for item in items %}
<div{{ attributes.addClass(classes, 'field__item') }}><h3><i class="fa-solid fa-link"></i>&nbsp;<a href="http://proxy.library.upei.ca/login?url={{ item.content['#url']}}">{{ item.content['#title']}}</a></h3></div>
{% endfor %}
{% endif %}
{% else %}
<div{{ attributes.addClass(classes) }}>
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
{% if multiple %}
<div class="field__items">
{% endif %}
{% for item in items %}
<div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
test4
{% endfor %}
{% if multiple %}
</div>
{% endif %}
</div>
{% endif %}

4
templates/components/lp-news-blocks/views-view-fields--landing_page_news_blocks.html.twig

@ -32,7 +32,6 @@
*/ */
#} #}
<a class="news-grid__link" href="/node/{{ fields.nid.content|striptags }}">
<div class="callout news-grid__tile events media-object"> <div class="callout news-grid__tile events media-object">
<div class="news-grid__image media-object-section"> <div class="news-grid__image media-object-section">
<div class="thumbnail"> <div class="thumbnail">
@ -40,11 +39,12 @@
</div> </div>
</div> </div>
<div class="media-object-section news-grid__text"> <div class="media-object-section news-grid__text">
<a class="news-grid__link" href="/node/{{ fields.nid.content|striptags }}">
<h3> {{ fields.title.content|striptags }} </h3> <h3> {{ fields.title.content|striptags }} </h3>
<div> <div>
{{ fields.body.content }} {{ fields.body.content }}
</div> </div>
</a>
</div> </div>
</div> </div>
</a>

0
templates/components/menu--main.html.twig → templates/components/menu--main.html.twig.old

31
templates/components/region--header.html.twig

@ -20,22 +20,23 @@
%} %}
{% if content %} {% if content %}
{#foundation title bar#} {#foundation title bar#}
<div class="title-bar" data-responsive-toggle="topbar-desktop" data-hide-for="large">
<ul class="branding menu">
<li>
<a href="/" rel="home" class="site-logo">
<img src="/themes/roblib_2023/logo.svg" alt="Home">
</a>
</li>
<li>
<span class="site-name">
<a href="/" title="Home" rel="home">Robertson<br>Library</a>
</span>
</li>
</ul>
<button class="menu-icon" type="button" data-toggle="topbar-desktop"></button>
</div> {#<div class="title-bar" data-responsive-toggle="topbar-desktop" data-hide-for="large">#}
{#<ul class="branding menu">#}
{#<li>#}
{#<a href="/" rel="home" class="site-logo">#}
{#<img src="/themes/roblib_2023/logo.svg" alt="Home">#}
{#</a>#}
{#</li>#}
{#<li>#}
{#<span class="site-name">#}
{#<a href="/" title="Home" rel="home">Robertson<br>Library</a>#}
{#</span>#}
{#</li>#}
{#</ul>#}
{#<button class="menu-icon" type="button" data-toggle="topbar-desktop"></button>#}
{#</div>#}

64
templates/components/search-facets/facets-item-list.html.twig

@ -0,0 +1,64 @@
{#
/**
* @file
* Default theme implementation for a facets item list.
*
* Available variables:
* - items: A list of items. Each item contains:
* - attributes: HTML attributes to be applied to each list item.
* - value: The content of the list element.
* - title: The title of the list.
* - list_type: The tag for list element ("ul" or "ol").
* - wrapper_attributes: HTML attributes to be applied to the list wrapper.
* - attributes: HTML attributes to be applied to the list.
* - empty: A message to display when there are no items. Allowed value is a
* string or render array.
* - context: A list of contextual data associated with the list. May contain:
* - list_style: The ID of the widget plugin this facet uses.
* - facet: The facet for this result item.
* - id: the machine name for the facet.
* - label: The facet label.
*
* @see facets_preprocess_facets_item_list()
*
* @ingroup themeable
*/
#}
{% if cache_hash %}
<!-- facets cacheable metadata
hash: {{ cache_hash }}
{% if cache_contexts %}
contexts: {{ cache_contexts }}
{%- endif %}
{% if cache_tags %}
tags: {{ cache_tags }}
{%- endif %}
{% if cache_max_age %}
max age: {{ cache_max_age }}
{%- endif %}
-->
{%- endif %}
<div class="facets-widget- {{- facet.widget.type -}} ">
{% if facet.widget.type %}
{%- set attributes = attributes.addClass('item-list__' ~ facet.widget.type) %}
{% endif %}
{% if items or empty %}
{%- if title is not empty -%}
<h3>{{ title }}</h3>
{%- endif -%}
{%- if items -%}
<{{ list_type }}{{ attributes.addClass("menu vertical") }}>
{%- for item in items -%}
<li{{ item.attributes }}>{{ item.value }}</li>
{%- endfor -%}
</{{ list_type }}>
{%- else -%}
{{- empty -}}
{%- endif -%}
{%- endif %}
{% if facet.widget.type == "dropdown" %}
<label id="facet_{{ facet.id }}_label">{{ 'Facet'|t }} {{ facet.label }}</label>
{%- endif %}
</div>

28
templates/components/search-facets/facets-result-item.html.twig

@ -0,0 +1,28 @@
{#
/**
* @file
* Default theme implementation of a facet result item.
*
* Available variables:
* - value: The item value.
* - raw_value: The raw item value.
* - show_count: If this facet provides count.
* - count: The amount of results.
* - is_active: The item is active.
* - facet: The facet for this result item.
* - id: the machine name for the facet.
* - label: The facet label.
*
* @ingroup themeable
*/
#}
{% if is_active %}
<span class="facet-item__status js-facet-deactivate"><i class="fa-solid fa-circle-minus"></i>&nbsp;</span>
<span class="facet-item__value">{{ value }}</span>
{% else %}
<span class="facet-item__status js-facet-deactivate"><i class="fa-solid fa-circle-plus"></i>&nbsp;</span>
<span class="facet-item__value">{{ value }}</span>
{% endif %}
{% if show_count %}
<span class="facet-item__count">({{ count }})</span>
{% endif %}

64
templates/content/node--5706.html.twig

@ -0,0 +1,64 @@
<style>
.accordion {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
transition: 0.4s;
}
.active, .accordion:hover {
background-color: #ccc;
}
.panel {
padding: 0 18px;
background-color: white;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
</style>
</head>
<body>
<h2>Animated Accordion</h2>
<p>Click on the buttons to open the collapsible content.</p>
<button class="accordion">Section 1</button>
<div class="panel">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<button class="accordion">Section 2</button>
<div class="panel">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<button class="accordion">Section 3</button>
<div class="panel">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<script>
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
}
</script>
Loading…
Cancel
Save