-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from sitecrafting/curated-results
Curated results
- Loading branch information
Showing
13 changed files
with
189 additions
and
18 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
17 changes: 17 additions & 0 deletions
17
views/frontend/curated-result-field-templates/curated-result-field-template-button.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
$field = $data['curated_result_field'] ?? []; | ||
|
||
?> | ||
|
||
<?php foreach ($field['value'] as $field_link) : ?> | ||
|
||
<?php $render = true; ?> | ||
<?php if ( ($field_link['link_text'] ?? false) === false || empty($field_link['link_text'])) : $render = false; endif; ?> | ||
<?php if ( ($field_link['url'] ?? false) === false || empty($field_link['url'])) : $render = false; endif; ?> | ||
|
||
<?php if ($render) : ?> | ||
<a href="<?= $field_link['url'] ?>" target="<?= (isset($field_link['new_window']) && $field_link['new_window'] ? '_blank' : '_self') ?>" class="curated-result-<?= $field['type'] ?>"><?= $field_link['link_text'] ?></a> | ||
<?php endif; ?> | ||
|
||
<?php endforeach; ?> |
13 changes: 13 additions & 0 deletions
13
views/frontend/curated-result-field-templates/curated-result-field-template-headline.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
$field = $data['curated_result_field'] ?? []; | ||
|
||
?> | ||
|
||
<?php foreach ($field['value'] as $field_value) : ?> | ||
|
||
<?php if ($field_value['headline'] ?? false && !empty($field_value['headline'])) : ?> | ||
<h3 class="curated-result-<?= $field['type'] ?>"><?= $field_value['headline'] ?></h3> | ||
<?php endif; ?> | ||
|
||
<?php endforeach; ?> |
17 changes: 17 additions & 0 deletions
17
views/frontend/curated-result-field-templates/curated-result-field-template-link.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
$field = $data['curated_result_field'] ?? []; | ||
|
||
?> | ||
|
||
<?php foreach ($field['value'] as $field_link) : ?> | ||
|
||
<?php $render = true; ?> | ||
<?php if ( ($field_link['link_text'] ?? false) === false || empty($field_link['link_text'])) : $render = false; endif; ?> | ||
<?php if ( ($field_link['url'] ?? false) === false || empty($field_link['url'])) : $render = false; endif; ?> | ||
|
||
<?php if ($render) : ?> | ||
<a href="<?= $field_link['url'] ?>" target="<?= ($field_link['new_window'] ? '_blank' : '_self') ?>" class="curated-result-<?= $field['type'] ?>"><?= $field_link['link_text'] ?></a> | ||
<?php endif; ?> | ||
|
||
<?php endforeach; ?> |
12 changes: 12 additions & 0 deletions
12
views/frontend/curated-result-field-templates/curated-result-field-template-text.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
$field = $data['curated_result_field'] ?? []; | ||
?> | ||
|
||
<?php foreach ($field['value'] as $field_value) : ?> | ||
|
||
<?php if ($field_value['text'] ?? false && !empty($field_value['text'])) : ?> | ||
<div class="curated-result-<?= $field['type'] ?>"><?= $field_value['text'] ?></div> | ||
<?php endif; ?> | ||
|
||
<?php endforeach; ?> |
13 changes: 13 additions & 0 deletions
13
views/frontend/curated-result-templates/curated-result-template-quick_links.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
$result = $data['curated_result'] ?? []; | ||
|
||
?> | ||
|
||
<?php foreach ($result['fields'] as $field) : ?> | ||
|
||
<?= apply_filters('sitka/render', 'curated-result-field-templates/curated-result-field-template-'.$field['type'].'.php', array_merge($data, [ | ||
'curated_result_field' => $field, | ||
])) ?> | ||
|
||
<?php endforeach; ?> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
$result = $data['curated_result'] ?? []; | ||
|
||
?> | ||
<div class="sitka-curated-result"> | ||
<?= apply_filters('sitka/render', 'curated-result-templates/curated-result-template-'.$result['template'].'.php', array_merge($data, [ | ||
'curated_result' => $result, | ||
])) ?> | ||
</div> |
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