Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page Alias - loses app header #297

Open
DavieReid opened this issue Mar 29, 2023 · 3 comments
Open

Page Alias - loses app header #297

DavieReid opened this issue Mar 29, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@DavieReid
Copy link
Contributor

When you give a page an alias, the alias works fine and the page content etc is visible. However, the app header content is removed so it looks empty.

I think it might be related to the shared config being lost somehow

@DavieReid DavieReid added the bug Something isn't working label Mar 29, 2023
@DavieReid
Copy link
Contributor Author

confirmed the shared config is lost. Investigating further

@DavieReid
Copy link
Contributor Author

Shared Config Flow

  1. frameOverrides added to site index page (usually)
  2. CodeModPlugin (first plugin to run) detects the frameOverrides property
  3. CodeModPlugin sets page.sharedConfig to be the same as frameOverrides
  4. CodeModPlugin sets page.frameOverrides to reference the new sharedConfig property
  5. SharedConfigPlugin runs and detects the sharedConfig property
  6. SharedConfigPlugin writes the shared config out to a json file
  7. SharedConfigPlugin creates a ref to the shared config json file
  8. User requests a page
  9. SharedConfig middleware uses the requested page url to find the shared config json file

The broken part:
When the page uses an alias, the SharedConfig middleware won't find the shared config json file.

Example

  1. Request page /mosaic/author/aliases
  2. Shared config should be located at /mosaic/author/shared-config.json

But this page also provides an alias:

  1. Request alias /mosaic/example/aliases
  2. There is NO json file at /mosaic/example/shared-config.json

@DavieReid
Copy link
Contributor Author

Workaround is to manually ref the shared config in the aliased page frontmatter

sharedConfig:
  $ref: /mosaic/index#/sharedConfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant