-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Add tree/card view toggle for pages list with scheme-based control #822
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
base: 2.x
Are you sure you want to change the base?
Conversation
Introduces a new card/grid view for pages alongside the existing tree view in the panel. Adds a view mode toggle in the UI, updates the controller to handle the view mode, implements the card layout in a new SCSS and PHP view, and updates translations. Also enhances the TypeScript to handle view mode switching and persistence.
Introduced a toggle for tree and card views in the pages list, visible when 'subtreeGridDisplay' is enabled in the parent page's scheme. Updated controller logic to validate and pass view mode, adjusted SCSS for improved styling, and modified the blog page scheme as an example configuration.
Added /docs/ to .gitignore to exclude documentation files from version control. Deleted FEATURE_CHANGELOG.md as it is no longer needed.
Introduced a new .pages-view-toggle wrapper for the view mode buttons in the pages panel, updated the SCSS to style this component, and refactored the index.php view to use the new structure. Also removed Kirby-specific comments from SCSS for clarity.
Introduces the imagePreviewField option set to 'coverImage' in the post page scheme to enable image previews in the admin interface.
Refines the SCSS for page list components, adjusting font sizes, colors, spacing, and button visibility for better UI consistency. Updates the page tree view to display image previews as thumbnails within the page icon area, removing the previous larger image preview from the details section.
The default view mode now depends on the parent's grid display setting: 'card' if grid display is enabled, otherwise 'tree'. This improves the user experience by aligning the default view with the configured display option.
Enhanced the Pages component to apply search filtering and highlighting to the card view, in addition to the tree view. Card elements are now shown or hidden based on the search input, and matching text is highlighted.
Introduces a page icon next to the title in page cards by updating the cards.php view and adding new SCSS classes for layout and styling. Also refines related SCSS for better alignment, overflow handling, and hover effects for page card icons.
Updated SCSS variables and component styles for buttons, dropdowns, header, sidebar, section, and pages tree to improve visual consistency, spacing, and color scheme. Refactored layout markup in panel.php and pages/index.php to unify header structure and remove duplicate header code. These changes enhance the overall look and feel of the panel interface.
Replaces <div class="header"> with <header class="panel-header"> across multiple panel view files for improved semantic HTML structure and consistency.
Refactors the pages index header to use a new breadcrumb navigation, improved search bar, and updated action controls. Updates SCSS to add styles for the new header layout, breadcrumb, search, and action elements, providing a more modern and organized UI.
Adjusted background and border colors in panel SCSS for improved UI consistency, and added spacing to the page editor form. Updated the page editor form to use an ID for styling. Renamed blog and about page directories from '2-blog' to '1-blog' and '1-about' to '2-about' for better organization.
Updated SCSS for the files list to improve spacing, borders, font sizes, and hover effects for better visual clarity. Changed the header markup in files/edit.php from a div to a semantic header element for improved accessibility and structure.
Added border radius and background color to .files-item in SCSS for improved appearance. Changed the container class in files index.php from 'section' to 'mt-4' to adjust vertical spacing.
|
are you going to look in this or not @giuscris? |
|
Thank you for the PR, I'll review when possible (I'm currently working on Formwork 2.3) |
|
Hello @OffLine911, I appreciate your enthusiasm in exploring and experimenting with the panel styles. I am having difficulty reviewing your changes. They go too far beyond the scope of this PR, which should focus on the tree/tab + toggle display. The overall panel styles and element placement should be left untouched. They can of course be discussed, but should be addressed elsewhere. I feel that there are many random aesthetic changes that do not necessarily contribute to improving the experience, such as animation and inconsistent changes to font size, alignment, and text case. Furthermore, all of these changes are primarily geared towards dark color schemes, with a negative impact on the light theme. The removal of the header bar is also a significant change. While I am not completely opposed to this idea and am again open to discussion, the current implementation removes visual feedback (action label) and actual functionality (the link to site options, the site view button). I think the overall character of the Formwork panel is lost with these changes without significant improvements beyond a subjective idea of a "modern look". I'm asking if you can narrow down the changes to the scope of the PR so that we can finally review and implement them. For other ideas I suggest you to use the repository Discussions. Thanks again. I'll be happy to review a focused PR. |
|
okay thank you for taking some time and review this well i did change in the admin panel after seeing you wanted theme first i was going to only add the card view option but this is not problem you can check if you have time the Commit of this PR and before latest commit before changing the admin panel UI. i will make this pr draft for you so you can take your time. Right now i don't have mush time to redo the pr and stuff. so thank you and good luck. |
Summary
Adds a view mode toggle to switch between tree (list) and card (grid) display for pages in the admin panel. The toggle buttons only appear when explicitly enabled via the subtreeGridDisplay option in the parent page's scheme configuration.
Motivation
Provides a more visual way to browse pages with preview images, particularly useful for content types like blog posts, portfolios, or galleries where visual representation is important. The feature is opt-in per page type, maintaining backward compatibility.
Changes
Frontend
Backend
JavaScript
Styling
Translations
Usage
To enable card view toggle for a page type, add to the scheme YAML:
Example
Updated site/schemes/pages/blog.yaml with subtreeGridDisplay: true as a reference implementation.Technical Details
Files Modified
Testing