-
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
Open
OffLine911
wants to merge
31
commits into
getformwork:2.x
Choose a base branch
from
OffLine911:2.x
base: 2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Author
|
are you going to look in this or not @giuscris? |
Member
|
Thank you for the PR, I'll review when possible (I'm currently working on Formwork 2.3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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