From a8b5913f8e9d12a6d1e67bac4af51e0c28c71175 Mon Sep 17 00:00:00 2001
From: mnshantz <mnshantz@uwaterloo.ca>
Date: Fri, 1 Jun 2018 08:58:15 -0400
Subject: [PATCH] quicklinks paragraph work so far...

---
 ...agraph--uw-para-quicklinks-block.html.twig |  6 ++++
 uw_fdsu_theme_resp.theme                      | 33 +++++++++++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 templates/paragraphs/paragraph--uw-para-quicklinks-block.html.twig

diff --git a/templates/paragraphs/paragraph--uw-para-quicklinks-block.html.twig b/templates/paragraphs/paragraph--uw-para-quicklinks-block.html.twig
new file mode 100644
index 00000000..26961a13
--- /dev/null
+++ b/templates/paragraphs/paragraph--uw-para-quicklinks-block.html.twig
@@ -0,0 +1,6 @@
+{% include '@organisms/single-page/quicklinks-block/quicklinks-block.twig' with {
+    'anchor_link': anchor_link,
+    'display_title': display_title,
+    'title': content.field_uw_block_title|field_value,
+    'quicklinks': content.field_uw_quicklink
+} %}
\ No newline at end of file
diff --git a/uw_fdsu_theme_resp.theme b/uw_fdsu_theme_resp.theme
index 01114a54..c045d694 100644
--- a/uw_fdsu_theme_resp.theme
+++ b/uw_fdsu_theme_resp.theme
@@ -109,6 +109,39 @@ function uw_fdsu_theme_resp_preprocess_paragraph(&$variables) {
         $variables['display_title'] = "Off";
       }
 
+      break;
+    case "uw_para_quicklinks_block":
+
+      $display_title = _uw_fdsu_theme_resp_get_field_value_from_paragraph($variables['paragraph'], 'field_uw_display_title');
+
+      // If the title is to be displayed, set variable to On.
+      if ($display_title) {
+        $variables['display_title'] = "On";
+      }
+      // If the title is not to be displayed, set variable to Off.
+      else {
+        $variables['display_title'] = "Off";
+      }
+
+      // Set the anchor link.
+      $variables['anchor_link'] = _uw_fdsu_theme_resp_get_field_value_from_paragraph($variables['paragraph'], 'field_uw_anchor_link');
+
+      // Set the responsive image variables.
+     // _uw_fdsu_theme_resp_add_responsive_image_variables($variables, 'field_uw_icon_image', 'uw_resp_is_marketing_item');
+
+      // Set link section title
+      //$variables['quicklinks'] = _uw_fdsu_theme_resp_get_field_value_from_paragraph($variables['paragraph'], array(
+      //    [0] => [
+      //    'img_src' => 'field_uw_icon_image',
+      //    'link_section_title' => 'field_uw_link_section_title',
+      //    'links' => 'field_uw_quicklinks_links',
+      //]);
+//vardumper($variables['content']['field_uw_quicklink']);
+
+$sources= _uw_fdsu_theme_resp_add_responsive_image_variables($variables['content']['field_uw_quicklink'][0], 'field_uw_icon_image', 'uw_resp_is_marketing_item', TRUE);
+vardumper($sources);
+
+
       break;
   }
 }
-- 
GitLab