Add ability to switch content used by template using top navigation
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3541033. --> Reported by: [hooroomoo](https://www.drupal.org/user/3688872) Related to !21 >>> <h3 id="overview">Overview</h3> <p>When the user is creating or editing a content template they need to select an entity of the same bundle to use to preview template.</p> <h3 id="proposed-resolution">Proposed resolution</h3> <p>1. Following the pattern of code components (where we want to display the current context for the dropdown with the pages), we want to have one dropdown that shows the current template the user is on with a dropdown list will be the list of pages. And the second dropdown will show the current content the template is using the dropdown list will contain the list of different content for the given bundle. </p> <p><img src="https://www.drupal.org/files/issues/2025-08-12/design_preview_entity_select.png" alt="screenshot for selecting entity"></p> <p>2. Use the HTTP API introduced in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3541006" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3541006</a></span> to list the available entities with their title, and implement choosing an entity which should navigate to the route where the selected entity is loaded and can be presented in the preview canvas. If <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3541031" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3541031</a></span> lands before this issue, make sure the implementation handles the route change and data loading.</p> <p>3. Build the UI for the case when a site builder doesn't have content yet for a template (see screenshot below). The badge of the second dropdown should say "No content available" and also there should be a link for the user to create a piece of content for the given content type in the error message.</p> <h3 id="ui-changes">User interface changes</h3> <p>Designs for:<br> <strong>As a site builder I have no content when building my content type template but I want to build my template</strong></p> <p><img src="https://www.drupal.org/files/issues/2025-09-10/Screenshot%202025-09-10%20at%205.22.28%E2%80%AFPM.png" alt="no content"></p> <p>The "Add (insert content type here)" button should be a link that opens a new tab to the Drupal UI for the user to create that content<br> <img src="https://www.drupal.org/files/issues/2025-09-10/Screenshot%202025-09-10%20at%205.22.43%E2%80%AFPM.png" alt="drupal admin ui"></p> <p><img src="https://www.drupal.org/files/issues/2025-08-12/design_preview_entity_select.png" alt="screenshot for selecting entity"><br> When the user is creating or editing a content template they need to select an entity of the same bundle to use to preview template.</p> <p><a href="https://www.figma.com/design/0NFfNz2uJWs8Kr2pMpLXPf/External---Experience-Builder---Design-System?node-id=7163-43365&amp;m=dev">https://www.figma.com/design/0NFfNz2uJWs8Kr2pMpLXPf/External---Experience-Builder---Design-System?node-id=7163-43365&amp;m=dev</a></p> > Related issue: [Issue #3541006](https://www.drupal.org/node/3541006) > Related issue: [Issue #3541031](https://www.drupal.org/node/3541031) > Related issue: [Issue #3541000](https://www.drupal.org/node/3541000)
issue