UCDavisLibrary / ucdlib-theme-wp

Wordpress theme port of the UC Davis SiteFarm One Theme
2 stars 0 forks source link

Add Patterns: Contact Us #132

Closed wrenaria closed 2 years ago

wrenaria commented 2 years ago

Please add these two Patterns for Contact options.

Pattern Name: Contact Us

<!-- wp:ucd-theme/heading {"content":"Contact Us","className":"is-style-highlight"} /-->

<!-- wp:paragraph -->
<p>[Optional] For any questions related to [page topic], please contact us.</p>
<!-- /wp:paragraph -->

<!-- wp:group -->
<div class="wp-block-group"><!-- wp:ucd-theme/prefixed-icon-link {"icon":"ucd-public:fa-envelope"} /-->

<!-- wp:ucd-theme/prefixed-icon-link {"icon":"ucd-public:fa-phone"} /--></div>
<!-- /wp:group -->

<!-- wp:ucd-theme/spacer {"x":"small","y":"small"} /-->

Pattern Name: Contact Us (Multi)

<!-- wp:ucd-theme/heading {"content":"Contact Us","className":"is-style-highlight"} /-->

<!-- wp:paragraph -->
<p>[Optional] For any questions related to [page topic], please contact us.</p>
<!-- /wp:paragraph -->

<!-- wp:group -->
<div class="wp-block-group"><!-- wp:ucd-theme/heading {"content":"Department or Audience","level":3,"classSuffix":"h6"} /-->

<!-- wp:ucd-theme/prefixed-icon-link {"icon":"ucd-public:fa-envelope"} /-->

<!-- wp:ucd-theme/prefixed-icon-link {"icon":"ucd-public:fa-phone"} /--></div>
<!-- /wp:group -->

<!-- wp:ucd-theme/spacer {"x":"small","y":"small"} /-->

<!-- wp:group -->
<div class="wp-block-group"><!-- wp:ucd-theme/heading {"content":"Department or Audience","level":3,"classSuffix":"h6"} /-->

<!-- wp:ucd-theme/prefixed-icon-link {"icon":"ucd-public:fa-envelope"} /-->

<!-- wp:ucd-theme/prefixed-icon-link {"icon":"ucd-public:fa-phone"} /--></div>
<!-- /wp:group -->

<!-- wp:ucd-theme/spacer {"x":"small","y":"small"} /-->

<!-- wp:group -->
<div class="wp-block-group"><!-- wp:ucd-theme/heading {"content":"Department or Audience","level":3,"classSuffix":"h6"} /-->

<!-- wp:ucd-theme/prefixed-icon-link {"icon":"ucd-public:fa-envelope"} /-->

<!-- wp:ucd-theme/prefixed-icon-link {"icon":"ucd-public:fa-phone"} /--></div>
<!-- /wp:group -->

<!-- wp:ucd-theme/spacer {"x":"small","y":"small"} /-->
spelkey-ucd commented 2 years ago

@UcDust you will need to set up a patterns.php file in the theme and load it in site.php

Should look something like this.

UcDust commented 2 years ago

Thanks!

UcDust commented 2 years ago

Hi @wrenaria, this should be on sandbox now.

spelkey-ucd commented 2 years ago

and fyi @wrenaria , we can use whatever category name you want. same with title, description, and search terms...

wrenaria commented 2 years ago

I forgot a spacer in the "(Multi)" version of the Contact Us (Friday brain!). I updated the code above. Otherwise they are looking good.

Is it possible to have the Patterns default to the "Library Theme" category when you go to the Patterns tab? That'll help our content creators find stuff meant for them faster.

UcDust commented 2 years ago

Perfect thanks! I bet if we changed the title to 'Library Defaults' it would be the shown first. Otherwise I can look to see if there's a way to change that in code.

UcDust commented 2 years ago

I take that back, it doesn't help. Let me find what controls that.

UcDust commented 2 years ago

We can control the priority that the patterns are registered in WP, so we can change the locations post type plugin to have a lower priority which allows the Library Theme patterns to be the default. I'll send this to code review and hopefully we can get it deployed tomorrow.

wrenaria commented 2 years ago

The patterns display and defaulting to Library Theme category look good! This is ready for stage.