-
Notifications
You must be signed in to change notification settings - Fork 359
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
Add record tab for displaying channels. #4165
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice functionality, and the code looks fine. One functional comment below.
Discuss: should we deprecate the "similar items" tab in favor of the richer channels tab? We could create a default configuration of the Channels tab that behaves almost exactly like similar items in order to take its place. (This might make the most sense as a follow-up action after merging this PR).
Yes I think this would be a good follow-up PR. That old carousel is not great.
$request = $this->getRequest() ?: null; | ||
$query = $request?->getQuery(); | ||
$driver = $this->getRecordDriver(); | ||
$context = ['displaySearchBox' => $this->options['include_channels_search_box'] ?? false]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this being false by default; I'm having trouble imagining why anyone would want the search box in this context at all, but I guess it's good for discovery of the channels feature.
@@ -23,7 +23,7 @@ | |||
} | |||
?> | |||
|
|||
<?php if (empty($token)): ?> | |||
<?php if (empty($token) && ($displaySearchBox ?? true)): ?> | |||
<form action="<?=$this->url('channels-search')?>" class="channel-search form-inline"> | |||
<?=$this->transEsc('channel_searchbox_label')?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the search box is enabled, which again I'm confused on, I wonder if the label would need to be different in this context. On the one hand, the search box does the exact same thing, so probably not. On the other hand, would the patron be expecting the list of channels to be more record-relevant, and so the label might want to reinforce that? IDK.
This PR creates a tab to embed channels on the record page. It is configured to be disabled by default; uncomment the relevant line(s) in RecordTabs.ini to try it out.
This also adds a missing translation: the text "Channels" is already used in breadcrumbs but was missing from language files.
The ChannelLoader code has also been simplified to take advantage of constructor property promotion.
TODO: