Skip to content

Commit

Permalink
implement customisable url redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLungu committed Feb 21, 2025
1 parent 372b198 commit 45e0b57
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 65 deletions.
124 changes: 80 additions & 44 deletions wp-content/themes/engage-2-x/acf-json/group_67994fb691c82.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"class": "",
"id": ""
},
"layout": "block",
"layout": "row",
"sub_fields": [
{
"key": "field_679a6479f28c8",
Expand Down Expand Up @@ -91,7 +91,7 @@
"class": "",
"id": ""
},
"layout": "block",
"layout": "row",
"sub_fields": [
{
"key": "field_67b3acea66ba4",
Expand Down Expand Up @@ -151,11 +151,11 @@
"allow_in_bindings": 0
},
{
"key": "field_67b4e220f1926",
"label": "BrandBar Logo (UT)",
"name": "brandbar_logo_ut",
"key": "field_67b63b4f73685",
"label": "Brand Bar",
"name": "brand_bar",
"aria-label": "",
"type": "image",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
Expand All @@ -164,43 +164,79 @@
"class": "",
"id": ""
},
"return_format": "array",
"library": "all",
"min_width": "",
"min_height": "",
"min_size": "",
"max_width": "",
"max_height": "",
"max_size": "",
"mime_types": "",
"allow_in_bindings": 0,
"preview_size": "medium"
},
{
"key": "field_67b4e544521ea",
"label": "BrandBar Logo (Moody)",
"name": "brandbar_logo_moody",
"aria-label": "",
"type": "image",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"return_format": "array",
"library": "all",
"min_width": "",
"min_height": "",
"min_size": "",
"max_width": "",
"max_height": "",
"max_size": "",
"mime_types": "",
"allow_in_bindings": 0,
"preview_size": "medium"
"layout": "table",
"sub_fields": [
{
"key": "field_67b4e220f1926",
"label": "BrandBar Logo (UT)",
"name": "brandbar_logo_ut",
"aria-label": "",
"type": "image",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"return_format": "array",
"library": "all",
"min_width": "",
"min_height": "",
"min_size": "",
"max_width": "",
"max_height": "",
"max_size": "",
"mime_types": "",
"allow_in_bindings": 0,
"preview_size": "medium"
},
{
"key": "field_67b4e544521ea",
"label": "BrandBar Logo (Moody)",
"name": "brandbar_logo_moody",
"aria-label": "",
"type": "image",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"return_format": "array",
"library": "all",
"min_width": "",
"min_height": "",
"min_size": "",
"max_width": "",
"max_height": "",
"max_size": "",
"mime_types": "",
"allow_in_bindings": 0,
"preview_size": "medium"
},
{
"key": "field_67b63b7f73686",
"label": "BrandBar Redirect",
"name": "brandbar_redirect",
"aria-label": "",
"type": "url",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "https:\/\/moody.utexas.edu",
"allow_in_bindings": 0,
"placeholder": ""
}
]
}
]
}
Expand All @@ -223,5 +259,5 @@
"active": true,
"description": "",
"show_in_rest": 0,
"modified": 1739908589
"modified": 1739996649
}
45 changes: 24 additions & 21 deletions wp-content/themes/engage-2-x/templates/partial/brandbar.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@
This is the topbar with the "TEXAS Moody" link
#}
<div class="brandbar">
<a href="https://moody.utexas.edu" class="brandbar__link">
<span class="sr-text">University of Texas at Austin</span>
<span class="brandbar__logo">
<picture>
<source srcset="{{options.navigation_settings.brandbar_logo_ut.url}}" type="image/webp">
<img src="{{options.navigation_settings.brandbar_logo_ut.url}}"
alt="University of Texas at Austin"
width="112"
height="27"
decoding="async">
</picture>
<picture>
<source srcset="{{options.navigation_settings.brandbar_logo_moody.url}}" type="image/webp">
<img src="{{options.navigation_settings.brandbar_logo_moody.url}}"
alt="Moody College of Communication"
width="85"
height="27"
decoding="async">
</picture>}
</span>
</a>

{% if options.navigation_settings.brand_bar %}
<a href="{{options.navigation_settings.brand_bar.brandbar_redirect}}" class="brandbar__link">
<span class="sr-text">University of Texas at Austin</span>
<span class="brandbar__logo">
<picture>
<source srcset="{{options.navigation_settings.brand_bar.brandbar_logo_ut.url}}" type="image/webp">
<img src="{{options.navigation_settings.brand_bar.brandbar_logo_ut.url}}"
alt="University of Texas at Austin"
width="112"
height="27"
decoding="async">
</picture>
<picture>
<source srcset="{{options.navigation_settings.brand_bar.brandbar_logo_moody.url}}" type="image/webp">
<img src="{{options.navigation_settings.brand_bar.brandbar_logo_moody.url}}"
alt="Moody College of Communication"
width="85"
height="27"
decoding="async">
</picture>
</span>
</a>
{% endif %}
</div>

0 comments on commit 45e0b57

Please sign in to comment.