Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Strange, differing behaviour on view all #372

Closed

Description

@svenHoskens

These issues might be unrelated. I've encountered them both in my own project, using starterkit-twig-base, and a demo project I just installed to make sure using starterkit-twig-demo.

I installed patternlab with composer create-project pattern-lab/edition-twig-standard example && cd $_ and run it using the generate command, followed by the server command.

The initial page load on localhost:8080 looks good. The of the shadow dom object looks like this:

<head>
    <title>Pattern Lab</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">

    <link rel="stylesheet" href="../../css/style.css?1472586900" media="all">
    <link rel="stylesheet" href="../../css/pattern-scaffolding.css?1472586900" media="all">

    <!-- Begin Pattern Lab (Required for Pattern Lab to run properly) -->
    <!-- never cache patterns -->
<meta http-equiv="cache-control" content="max-age=0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
<meta http-equiv="pragma" content="no-cache">

<link rel="stylesheet" href="../../styleguide/css/styleguide.min.css?1472586900" media="all">
<link rel="stylesheet" href="../../styleguide/css/prism-typeahead.min.css?1472586900" media="all">
    <!-- End Pattern Lab -->
</head>

However, once I use the navbar and click atoms > view all, the layout fails. The shadow dom's head has changed to this:

<head>
    <title>Pattern Lab</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">

    <link rel="stylesheet" href="../../css/style.css?1472586900" media="all">
    <link rel="stylesheet" href="../../css/pattern-scaffolding.css?1472586900" media="all">

    <!-- Begin Pattern Lab (Required for Pattern Lab to run properly) -->

    <!-- End Pattern Lab -->

  </head>

As you can see, all meta tags and stylesheets between the tags are not injected properly. From this point onward, styling for patternlab itself isn't correct and the navigation has stopped working.

Perhaps my second issue is related. If I click molecules > view all, the top navigation bar becomes duplicated. Inspecting the page reveals that the shadow dom object is a copy of the outer object. (For example, the of the inner object also has id="patternlab-head")

If I click on organisms > view all, I'm redirected to http://localhost:8080/?p=viewall-molecules-messaging. templates > view all also redirects to the wrong page, namely organisms-sections. The general, right most 'all' link seems to work fine.

Activity

  1. backlineint commented on Oct 26, 2016

    @backlineint

    I'm seeing the same issue with pattern-lab/edition-drupal-standard and the pattern-lab/starterkit-twig-drupal-minimal starter kit. The one thing that differs from @svenHoskens description is that I'm not seeing the navigation bar duplicated.

  2. backlineint commented on Oct 26, 2016

    @backlineint

    I'm also wondering if this issue belongs on https://github.com/pattern-lab/edition-php-drupal-standard I suppose it depends on where things are actually going off track.

  3. CraigGardener commented on Oct 30, 2016

    @CraigGardener

    I have experienced the same issue using the mustache version.

  4. kiwimind commented on May 12, 2017

    @kiwimind

    The same issue is apparent using https://github.com/phase2/pattern-lab-starter as well.

    My experience is the same as @backlineint in that I'm not seeing a duplicated navigation bar.

    Selecting the same option a second time does load the correct page, however the path still remains incorrect.

  5. EvanLovely commented on Oct 12, 2017

    @EvanLovely

    All fixed now as of v2.8.0!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions