Skip to content

Build: Add Support of cover image for pages and also grid view for list of pages#21

Merged
brij-mandaliya merged 11 commits intodevelopmentfrom
feature/add-cover-image-for-page
Apr 23, 2026
Merged

Build: Add Support of cover image for pages and also grid view for list of pages#21
brij-mandaliya merged 11 commits intodevelopmentfrom
feature/add-cover-image-for-page

Conversation

@brij-mandaliya
Copy link
Copy Markdown
Collaborator

@brij-mandaliya brij-mandaliya commented Oct 24, 2024

Fixes Issue : Support Page Cover Images and Page Grid View

Closes #18

Changes proposed

  • Add Grid view option for list of pages in chapter show page
  • Add Support of cover image for pages and also display cover image with each pages if cover image is available other
  • Add functionally of cover image at time of create page and update page also add reset cover image functionally at
    update time
  • change in setting file add page_view_type for change view of list of page in chapter page
  • also change in User Preferences controller add support of change the view of page

- Note That : At time of create page if you save draft then cover image will not save

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Screenshot from 2024-10-24 19-11-03
Screenshot from 2024-10-24 19-10-56
Screenshot from 2024-10-24 19-10-49

Note to reviewers

…in chapter show page with test case and update create test case for page and add two test case one for update cover image for page and another for reset cover image for page
Comment thread app/Entities/Models/Page.php Outdated

public function getPageCover(int $width = 440, int $height = 250): string
{
$default = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brijm-improwised default should be configurable using env

Copy link
Copy Markdown
Collaborator Author

@brij-mandaliya brij-mandaliya Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They implement this for book and for book they give this way only
that why i give this way

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

book they give this way only - @brijm-improwised Can you give example?

@brij-mandaliya brij-mandaliya self-assigned this Oct 28, 2024
@prohtex
Copy link
Copy Markdown

prohtex commented Jun 1, 2025

@brijm-improwised wow, this is exactly what I am looking for! Hope it can pass review :)

@poppew
Copy link
Copy Markdown

poppew commented Nov 11, 2025

So how can we use this feature? Would be great to get grid view with pictures..

@brij-mandaliya brij-mandaliya reopened this Apr 9, 2026
@munir131
Copy link
Copy Markdown

munir131 commented Apr 9, 2026

@brij-mandaliya Looks like there are conflicts

@brij-mandaliya
Copy link
Copy Markdown
Collaborator Author

@brij-mandaliya Looks like there are conflicts

Yes , I am working on that.

@poppew
Copy link
Copy Markdown

poppew commented Apr 11, 2026

@brij-mandaliya Looks like there are conflicts

Yes , I am working on that.

Cool, when do you think this might be checked in?

- Added `image_id` field to `entity_page_data` model and migration
- Updated `PageQueries` to select `image_id` and reference entity_page_data columns explicitly
- Modified `PageRepo` to handle cover image updates consistently for drafts and revisions
- Extended `EntityCover` and `EntityHtmlDescription` to support `Page` entities
- Adjusted `BookContents` queries to use entity_page_data.draft
- Updated Blade views to use `coverInfo()->getUrl()` for page list items
- Introduced sidebar view-toggle for pages in chapter actions
- Removed `ContainerTrait` from `Page` and replaced defaultTemplate with descriptionInfo
@brij-mandaliya
Copy link
Copy Markdown
Collaborator Author

@brij-mandaliya Looks like there are conflicts

Yes , I am working on that.

Cool, when do you think this might be checked in?

I’m working on this and have updated the logic. I’ll push a commit once it’s resolved.

…container_data table

- Move draft status from entities table to entity_container_data table
- Add fillable fields to EntityContainerData for image_id, sort_rule_id, and description fields
- Update all draft queries to use entity_page_data.draft join condition
- Enhance ReferenceChangeContext to track URL and permalink mappings during cloning
- Update ReferenceUpdater to process reference changes in descriptions and page content
- Modify cover image access to use coverInfo() method instead of cover property
- Fix entity-list-item class naming from chapter to page
- Update copy tests to verify reference updating during entity cloning

BREAKING CHANGE: Draft status is now stored in entity_container_data table instead of entities table
@brij-mandaliya brij-mandaliya merged commit 57779a2 into development Apr 23, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Page Cover Images and Page Grid View

5 participants