-
Notifications
You must be signed in to change notification settings - Fork 148
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
pkp/pkp-lib#836 book hooks and layout #157
Conversation
pkp/pkp-lib#836 book hooks and layout
That looks sensible, Nate. As for ways to make built-in content (author lists, etc.) rearrangeable on par with content added by plugins etc.: I think we'll need to continue with both a set of hooks (so plugins can work with content) and content coded directly in the templates (where it'll be something our community can work with without diving into the system deeply). Naive question: do you think it might be feasible to delegate ordering of elements completely to CSS (the |
Flexbox isn't supported until IE10, so What's your objection to including components (like abstract, published date, etc) in the hook scheme? We'd still use templates for them, they just wouldn't be coded directly into the one |
No objection to this, just considering the simplest/most readable way to maintain both plugin-based and template-based content without too much contortion. Agreed that For content within templates, it should be possible to add some Smarty functions to do something like...
The That'll keep things decently readable within the template while adding flexibility. The contortion comes in when we need to have templates self-describe so that some tool within administration can be used to rearrange the content added by these, alongside content that might come from plugins. That's why the In the administration area, we'd need to invoke the front-end template in order to cause those hooks to register themselves...
...plus some additional grunting and sweating to get the sequences to save and load. But I don't think that'll be too bad. Does that sound like a reasonable and maintainable approach? |
Yeah I like that approach because it will keep the core content right there in the template file rather than forcing people to figure out where it's buried in another file. I'm just going to save this discussion into my own trello for now, and we can come back it for 3.0 if we have time -- or later if we don't. |
This implements a more consistent markup pattern that we can use to allow components on the frontend to be added and swapped around while maintaining some visual consistency. This is useful, for example, to ensure the AddThis plugin or other plugins which add content via the hooks can blend in with other components on the page.
It's documented here and ideally will be a pattern that we maintain for other themes, so that plugin markup output can remain compatible with multiple themes.
In terms of our long-term goals, presses will want some way to control the content that appears on the book page. Bozana has pointed out that everyone is going to a pretty different set of content they want on the page. The hooks are a first-step for adding content. But I see flexibility progressing in maybe three stages:
(1) The hooks allow plugins to add content, and the markup pattern provides a clear way to keep the design consistent.
(2) We display all the core information via the hooks ourselves (abstract, downlaodable files, etc). We can then create a simple interface for them to choose where to put content, eg:
At this point plugins could register to appear on this table in the settings area:
(3) We actually make the article page function like sidebar blocks, so they can re-order them as they'd like.
If you agree that 3 would be somewhere we want to end up, should we adjust the markup pattern now, so that it follows the same markup pattern as block plugin markup? This would mean that, eventually, we could have convergence in the systems we have to manage (just one sidebar system, instead of having a separate kind of content block management system just for books).
The markup is easy to change now if you think it's a target worth aiming for.