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

How to change home page to list of recently added books? #527

Open
dunxd opened this issue Jun 21, 2023 · 2 comments
Open

How to change home page to list of recently added books? #527

dunxd opened this issue Jun 21, 2023 · 2 comments

Comments

@dunxd
Copy link

dunxd commented Jun 21, 2023

I'd like it if the initial view of index.php showed the most recently added books. That would be a bit more like walking into a real world library.

I figured I might be able to do this by editing index.php line 24:

$page     = getURLParam('page', Base::PAGE_INDEX);

The different pages are listed in lib/Base.php so I could just replace PAGE_INDEX with PAGE_ALL_RECENT_BOOKS. However, this isn't doing it - I still get the list of Author, Title etc.

I am struggling to get my head around the flow of the code to see where I can change the behaviour. Has anyone else managed to do this?

If I can get this working, then I can make the home page view configurable by adding a key to the $config array.

@mikespub
Copy link

The default start page is also defined separately in file lib/JSON_renderer.php function getJson() = same code on line 204 there.

This gets called via the getJSON.php URL by your browser if you use client-side rendering (=default), or by serverSideRender() in the index.php itself otherwise.

@mikespub
Copy link

Included in mikespub-org@35bcb8c and tag 1.4.1 at https://github.com/mikespub-org/seblucas-cops

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

No branches or pull requests

2 participants