forked from jspellman814/wordpress-composer-managed
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add location alert fields to homepage widget
** Why are these changes being introduced: * There is an upcoming closure to the Hayden library, and we want to enable UXWS staff to be able to add alerts to the homepage for cases like this without asking for EngX to modify static templates. * After discussing the needed feature among themselves, UX has decided that a separate field for homepage alerts was preferrable, because that space frequently needs a single line of text that does not replicate the uses of the existing title and body fields for the current alert information. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/pw-93 ** How does this address that need: * First, we add a new field to the Location Attributes fieldset, named alert_frontpage. This field appears next to the other location alert fields (alert_title and alert_content), with help text advising that this new field should only have links added to it. * Second, we add a method to the widget class (which is provided by the hours plugin) to check for content in this new field. If content is found, it is included in the widget output below that location's entry. * The styling for this display is taken from the former styles for the Hayden renovation alert, which was statically added to this partial. * Because the parent theme's styles are changing, we bump the theme version. ** Document any side effects to this change: * This ticket is validating our choice to go with a monorepo for our WordPress application - as the changes being made might have spanned across several repositories in our previous infrastructure (one for the hours widget, one for the parent theme to change the styling, and potentially a third for the data model change - although that may have just been a configuration and not a code change before). * While the use of a class method and not a function in a tempalte is good, we are still mixing content and code because we have hard- coded location names, phone numbers, etc - as well as the post IDs for our actual locations. I'm choosing not to continue pulling on this thread, however.
- Loading branch information
1 parent
79a4a15
commit 7beeb18
Showing
5 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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