Hide logos on recipe source

Created on 20 December 2024, 4 months ago

Problem/Motivation

Our design for the recipes page currently doesn't include a design. In the future, we will likely want imagery that helps to covey what the recipe provides, but in the meantime we think that icons or logos will potentially be distracting. Not to mention that it will be very difficult to design logos that provide much meaning.

Proposed resolution

Update the recipe source to not display the logo.

πŸ“Œ Task
Status

Active

Version

2.0

Component

User experience

Created by

πŸ‡¦πŸ‡ΊAustralia pameeela

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

Merge Requests

Comments & Activities

  • Issue created by @pameeela
  • Merge request !653Draft: Set logo to empty β†’ (Open) created by pameeela
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    In keeping with my strategy of doing something wrong just to get it started.... as suggested by @tim.plunkett, we can achieve this visually by just setting the logo to empty. It still outputs the div and img tag as empty which I think we need to fix.

  • Pipeline finished with Failed
    4 months ago
    Total: 459s
    #374454
  • πŸ‡ΊπŸ‡ΈUnited States chrisfromredfin Portland, Maine

    I think it is more distracting to switch sources and have an inconsistent UI. I would prefer to leave a default logo there.

  • πŸ‡ΊπŸ‡ΈUnited States chrisfromredfin Portland, Maine

    This diff should get us toward a selector we can use to style per-source. Stuffing it here before I run off.

    diff --git a/project_browser.module b/project_browser.module
    index a823a55..5fe7705 100644
    --- a/project_browser.module
    +++ b/project_browser.module
    @@ -38,7 +38,7 @@ function project_browser_help($route_name, RouteMatchInterface $route_match) {
     function project_browser_theme() {
       return [
         'project_browser_main_app' => [
    -      'variables' => [],
    +      'variables' => ['source_plugin' => NULL],
         ],
       ];
     }
    @@ -59,3 +59,15 @@ function project_browser_project_browser_source_info_alter(array &$definitions):
         ];
       }
     }
    +/**
    + * Implements template_preprocess_HOOK().
    + *
    + * @param mixed $variables
    + * @return void
    + */
    +function project_browser_preprocess_project_browser_main_app(&$variables) {
    +  // Pass the current route's "source" parameter as the source_plugin var.
    +  $route_match = \Drupal::service('current_route_match');
    +  $param = $route_match->getParameter('source') ?? NULL;
    +  $variables['source_plugin'] = $param;
    +}
    diff --git a/templates/project-browser-main-app.html.twig b/templates/project-browser-main-app.html.twig
    index f3768f4..b94487a 100644
    --- a/templates/project-browser-main-app.html.twig
    +++ b/templates/project-browser-main-app.html.twig
    @@ -11,4 +11,4 @@
          
       </div>
     </div>
    -<div id="project-browser"></div>
    +<div id="project-browser" data-pb-source="{{ source_plugin|clean_class }}"></div>
    

    See https://drupal.slack.com/archives/C01UHB4QG12/p1736163780116629

  • Pipeline finished with Failed
    2 months ago
    Total: 1356s
    #423024
  • Pipeline finished with Skipped
    2 months ago
    #423050
  • Pipeline finished with Success
    2 months ago
    Total: 1357s
    #423044
Production build 0.71.5 2024