roots / sage

WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow
https://roots.io/sage/
MIT License
12.75k stars 3.06k forks source link

[Sage 10] Bug: Primary sidebar not displayed #2960

Closed strarsis closed 2 years ago

strarsis commented 2 years ago

Terms

Description

What's wrong?

The primary sidebar isn't rendered on any page. Sidebar section part (currently in index.blade.php):

@section('sidebar')
  @include('sections.sidebar')
@endsection

What have you tried?

What insights have you gained?

The sidebar section never appears in the markup. Moving the sidebar section part from index.blade.php over to page.blade.php finally resulted in it being shown.

Possible solutions

Move the sidebar section part from index.blade.php to page.blade.php would make the sidebar appear on all pages. However, I am not sure whether this fixes an issue I introduced into the theme by modifying it or by some strange Gutenberg/widget constellation.

Temporary workarounds

Move sidebar section part from index.blade.php over to page.blade.php.

Steps To Reproduce

  1. Create a Sage 10 project (latest commit) (composer create-project roots/sage sage10 dev-main).
  2. Ensure all theme build + runtime dependencies are installed (yarn install; composer install if necessary).
  3. Build the theme to prevent any issues (yarn build).
  4. Activate the theme.
  5. Ensure the primary sidebar widget area contains something.
  6. Open frontend, check front-page and other pages. Note that the primary sidebar doesn't appear in the markup of any page.

Expected Behavior

Primary sidebar is shown on all pages.

Actual Behavior

Primary sidebar isn't shown on any page.

Relevant Log Output

No response

Versions

Remove config and bootstrap directories (#2839)

retlehs commented 2 years ago

hey @strarsis this is intentional - the sidebar is included for posts out of the box but not for pages

if you'd like to add support for the sidebar on pages, add it directly to your theme w/ whatever conditionals etc. you'd need