Season name needs unique class in View

Created on 9 January 2025, 27 days ago

Problem/Motivation

Giving a unique name to a Season is helpful, but trying to style it in Views has proven to be frustrating because it is assigned the same class as weekdays: "office-hours__item-label". It would be more helpful and better practice to assign a unique class to Season names.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.20

Component

Integrating Views

Created by

πŸ‡ΊπŸ‡ΈUnited States gallegosj

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gallegosj
  • πŸ‡³πŸ‡±Netherlands johnv

    Below is an extract of the HTML:

    <table class="office-hours__table">
        <thead>
          <tr>
                      <th class="inline">Day</th>
                      <th class="visually-hidden">Time slot</th>
                      <th class="visually-hidden">Comment</th>
                  </tr>
        </thead>
      
        <tbody> ... </tbody>
    </table>
    	
    <table class="office-hours__table office-hours__table_exception">
        <thead>
          <tr>
                      <th class="inline">Exception hours JVO</th>
                      <th class="visually-hidden">Time slot</th>
                      <th class="visually-hidden">Comment</th>
                  </tr>
        </thead>
      
        <tbody> ... </tbody>
    </table>
    	
    	
    <table class="office-hours__table office-hours__table_season">
        <thead>
          <tr>
                      <th class="inline">Spring2025</th>
                      <th class="visually-hidden">Time slot</th>
                      <th class="visually-hidden">Comment</th>
                  </tr>
        </thead>
      
          <tbody> ... </tbody>
    </table>

    I see the theming of the THEAD / TH is not ideal.

    Can you work with using <table class="office-hours__table"> <thead> <tr> ?

    What level would you expect? I suspect on the first TH element, or the surrounding TR element.

  • πŸ‡³πŸ‡±Netherlands johnv

    You can theme the caption for Weekdays, Exceptins and Seasons with the same style using

    /* Formatter settings - table formatter */
    .office-hours__table thead tr {
      /* Your styles here */
       color: yellow;
      font-weight: bold;
    }
    

    Does that help you?

  • πŸ‡ΊπŸ‡ΈUnited States gallegosj

    I should have clarified that we are using the Plain Text formatter for this View, so table elements will not help with styling.

  • πŸ‡ΊπŸ‡ΈUnited States gallegosj
  • πŸ‡³πŸ‡±Netherlands johnv

    This in not only in Views, but also in normal Node view.

  • πŸ‡³πŸ‡±Netherlands johnv

    This needs some additional code in OfficeHoursFormatterDefault class or the getRows() function.

    • johnv β†’ committed 553205f4 on 8.x-1.x
      Issue #3498532: Season name and Exception header need unique class in '...
  • πŸ‡³πŸ‡±Netherlands johnv

    Please try dev version with above commit, which is a combined effort of php, twig and css.

  • πŸ‡ΊπŸ‡ΈUnited States gallegosj

    Using latest dev version. Confirmed that unique class office-hours__item-caption has been added in Plain Text formatter. Thank you!

    Request: please omit the default styles for the stable release so that users can design their own without having to override these.

    .office-hours__item-caption {
        text-decoration-line: underline;
        margin-left: 20px;
    }
    • johnv β†’ committed 75636861 on 8.x-1.x
      Issue #3498532: Season name and Exception header need unique class in '...
  • πŸ‡³πŸ‡±Netherlands johnv

    Thanks,
    I will leave the indent in the css file. It also needed re-ordering, or the caption does not override the label.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024