-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create template for project cards on homepage #46
Comments
Pairing with @tblacknc -- who pointed out that there are 2 spots projects are defined:
These will need separate templates. They're connected by the |
I am reading this as saying that configuring the cards (top) part of the file is a separate issue from the Modal (bottom) part of the file. If that is the case, I believe it is complete. What is the process for review? Do I give the workflow we looked at before a go? The insert code function of this app doesn't seem to render it correctly. |
Ah, nice! Are you able to open a PR with your code? I have some time to take a look this weekend |
This is great--thanks! Let me see if I can pull someone in from leadership to try out making updates to project info once we merge the PR. Do you want to take a stab at templating the other piece? Otherwise, I'm happy to pick it up if needed / useful |
I can take on the modal section.... I am thinking that the script may need access to the database to populate the template. Take PAWS write up for example, that would be a mess to populate the DB via a static command. I have a request in to chris to have a walkthrough on the code path to for the projects link. Are you familiar with the path for the https://codeforphilly.org/projects link? I think this is a good DB example to work with. |
Here is the modal section converted to a template format with the template populated with static entries (vs. DB): https://pr-51.codeforphilly.sandbox.k8s.phl.io/
|
Adding this to share with people looking to update homepage Example homepage elementsCard example: Modal example: Example code for homepageExample project card:
Example modal:
|
Currently, we show cards for selected projects on the homepage (codeforphilly.org):
However, the HTML for each card is repeated, with information like heading hard-coded:
https://github.com/CodeForPhilly/codeforphilly.org/blob/develop/html-templates/home.tpl#L100-L115
Proposed Solution
If we use a template, then we can consolidate this repeated code into one place. In other words, we could have a template like this in the
home.tpl
page:And then create the individual cards using something like this:
Here is a link to the template engine docs (owoo). Note that it is fairly old, but if we can get our work pretty far, and post it on the #cfp-homepage-redesign channel, we can hopefully lean a bit on @themightychris to fill in any gaps.
Outcome
The homepage should look the exact same, but the underlying code should be much cleaner, since it uses the template. If there are any useful changes to the look / homepage content, let's handle them after implementing a template (just to be sure we get templating down).
The text was updated successfully, but these errors were encountered: