Skip to content

Commit

Permalink
Merge pull request #1223 from CuBoulder/issue/1220
Browse files Browse the repository at this point in the history
Articles: Bylines link to their respective connected Person Pages
  • Loading branch information
jcsparks authored and web-flow committed Aug 16, 2024
2 parents 1efd72b + c04b909 commit 68ce600
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- ### Articles: Bylines link to their respective connected Person Pages
### Articles
Adjusts the byline display so it links to the connected Person Page, using the connect page on the byline's field `Author Person Page`.

Resolves #1220
---

- ### Content List: Image size adjustment
### Content List Block
Adjusts size of "Sidebar" - styled Content List Block images to be exactly 75px on desktop and 50px on mobile screen sizes. Previously there was additional width added.
Expand Down
7 changes: 7 additions & 0 deletions css/ucb-article-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ article.ucb-page-style-dark {
padding-bottom: 1.75em;
}

article.ucb-page-style-dark .ucb-article-author-name a{
color: var(--ucb-gold)
}
article.ucb-page-style-dark .ucb-article-author-name a:hover{
color: var(--ucb-white)
}

/* Override for Dark-style Articles with a Title Image */
article.ucb-page-style-dark:has(.backgroundTitleDiv){
padding-top: 0;
Expand Down
13 changes: 12 additions & 1 deletion templates/field/field--field_ucb_article_byline.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{% for item in items %}
<span>{{item.content|render|striptags|trim}}</span>
{% set byline_entity = item.content['#entity'] %}
{% if byline_entity.field_author_person_page|length > 0 %}
{% set author_person_page_entity = byline_entity.field_author_person_page.0.entity %}
{% if author_person_page_entity %}
{% set url = url('entity.node.canonical', {'node': author_person_page_entity.id()}) %}
<a href="{{ url }}">{{ byline_entity.name.value }}</a>
{% else %}
<span>{{ byline_entity.name.value }}</span>
{% endif %}
{% else %}
<span>{{ byline_entity.name.value }}</span>
{% endif %}
{% endfor %}

0 comments on commit 68ce600

Please sign in to comment.