<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Create dynamic header and footer template in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Create-dynamic-header-and-footer-template/m-p/699877#M30653</link>
    <description>&lt;P&gt;I have a Drupal website which has header and footer managed by CMS. I would like to create the same header and footer in Hubspot. I would like to keep the header and footer in both website and Hubspot sync. I am exploring different options to achieve this. I have a few questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Would it be possible for a Hubspot template to generate the menu using JavaScript? I notice that we can insert custom HTML but I’m not sure how flexible to create a menu with data using JavaScript. It seems all items in the example I gave you are all static.&lt;/LI&gt;&lt;LI&gt;Would it be possible for Hubspot template to get data from other Hubspot service, e.g. HubDB.&lt;/LI&gt;&lt;LI&gt;Would it be possible to push data from our website to HubDB?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Sep 2022 09:46:05 GMT</pubDate>
    <dc:creator>amak</dc:creator>
    <dc:date>2022-09-29T09:46:05Z</dc:date>
    <item>
      <title>Create dynamic header and footer template</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-dynamic-header-and-footer-template/m-p/699877#M30653</link>
      <description>&lt;P&gt;I have a Drupal website which has header and footer managed by CMS. I would like to create the same header and footer in Hubspot. I would like to keep the header and footer in both website and Hubspot sync. I am exploring different options to achieve this. I have a few questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Would it be possible for a Hubspot template to generate the menu using JavaScript? I notice that we can insert custom HTML but I’m not sure how flexible to create a menu with data using JavaScript. It seems all items in the example I gave you are all static.&lt;/LI&gt;&lt;LI&gt;Would it be possible for Hubspot template to get data from other Hubspot service, e.g. HubDB.&lt;/LI&gt;&lt;LI&gt;Would it be possible to push data from our website to HubDB?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 09:46:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-dynamic-header-and-footer-template/m-p/699877#M30653</guid>
      <dc:creator>amak</dc:creator>
      <dc:date>2022-09-29T09:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic header and footer template</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-dynamic-header-and-footer-template/m-p/700123#M30659</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/455225"&gt;@amak&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;yes, you can generate menus with JavaScript&lt;/LI&gt;
&lt;LI&gt;yes, you can build menus with HubDB&lt;/LI&gt;
&lt;LI&gt;yes, you can push data from external pages to HubDB by the &lt;A href="https://developers.hubspot.com/docs/api/cms/hubdb" target="_blank" rel="noopener"&gt;HubDB API&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From my experience the easier way to go would be HubDB instead of JavaScript.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simple one-level menu with logo and HubDB module could look something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set menu_items = hubdb_table_rows(&amp;lt;tableId or name&amp;gt;) %}

&amp;lt;nav class="navWrapper"&amp;gt;
&amp;lt;div class="container"&amp;gt;
&amp;lt;div class="row"&amp;gt;
&amp;lt;div class="col logo"&amp;gt;
{{ logo }}
&amp;lt;/div&amp;gt;
&amp;lt;div class="col navigation"&amp;gt;
&amp;lt;ul&amp;gt;
{% for item in module.menu_items %}
&amp;lt;li&amp;gt;
&amp;lt;a href="{{ item.url }}"&amp;gt;{{ item.link_name }}&amp;lt;/a&amp;gt;
&amp;lt;/li&amp;gt;
{% endfor %}
&amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/nav&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are basically no limits what you can't do&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You'd like to add an icon or image to each nav-item? Add an image column or text, url column to your HubDB and write it like this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{# For all usecases: adding a unless- or if-statement around the img-tag will prevent loading an empty img-tag in your DOM. I like unless since it's easier to find in modules when working with multiple statements #}

{% unless item.image.src== "" %}
&amp;lt;img src="{{item.image.src" alt="item.image.alt" class="nav-image"&amp;gt;
{% endunless %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 16:00:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-dynamic-header-and-footer-template/m-p/700123#M30659</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2022-09-29T16:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic header and footer template</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-dynamic-header-and-footer-template/m-p/700675#M30693</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot. Is there any documentation about building Hubspot template (&lt;A href="https://knowledge.hubspot.com/website-pages/understand-a-hubspot-template-setup" target="_blank" rel="noopener"&gt;https://knowledge.hubspot.com/website-pages/understand-a-hubspot-template-setup&lt;/A&gt;) with integration of HubDB module?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 05:39:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-dynamic-header-and-footer-template/m-p/700675#M30693</guid>
      <dc:creator>amak</dc:creator>
      <dc:date>2022-10-05T05:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic header and footer template</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-dynamic-header-and-footer-template/m-p/702111#M30734</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/455225"&gt;@amak&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes - there is somekind of documentation about HubDB, dynamic pages and such in the dev docu (&lt;A href="http://developers.hubspot.com" target="_blank" rel="noopener"&gt;developers.hubspot.com).&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;To be precise here some links:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://developers.hubspot.com/docs/cms/data/dynamic-pages#hubdb-dynamic-pages" target="_blank" rel="noopener"&gt;"Definition" of dynamic pages&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://developers.hubspot.com/docs/cms/guides/dynamic-pages/hubdb" target="_blank" rel="noopener"&gt;Building dynamic pages with HubDB&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://developers.hubspot.com/docs/cms/guides/dynamic-pages/hubdb/multilevel" target="_blank" rel="noopener"&gt;Building Multilevel pages with HubDB&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;What I always recommend is passing the "CMS for developers" certification in the HubSpot academy to get a basic understanding of Hubl and after that digging into the &lt;A href="https://developers.hubspot.com/docs/cms/hubl" target="_blank" rel="noopener"&gt;Hubl programming language&lt;/A&gt;, especially &lt;A href="https://developers.hubspot.com/docs/cms/hubl/if-statements" target="_blank" rel="noopener"&gt;if-statements,&lt;/A&gt; &lt;A href="https://developers.hubspot.com/docs/cms/hubl/for-loops" target="_blank" rel="noopener"&gt;loops&lt;/A&gt;, &lt;A href="https://developers.hubspot.com/docs/cms/hubl/functions" target="_blank" rel="noopener"&gt;functions&lt;/A&gt;(link is not broken; wait until you see the right sidebar) and &lt;A href="https://developers.hubspot.com/docs/cms/hubl/filters" target="_blank" rel="noopener"&gt;filters&lt;/A&gt;(link is not broken; wait until you see the right sidebar) since you're gonna need this knowledge for HubDB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also: You can get yourself a &lt;A href="https://developers.hubspot.com/get-started" target="_blank" rel="noopener"&gt;CMS developer sandbox&lt;/A&gt;(I recommend a CMS dev sandbox) so you don't mess things up in your live-portal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And last but not least: If you want to do things locally(can be harder when you're just starting), take a look at the &lt;A href="https://developers.hubspot.com/docs/cms/guides/getting-started-with-local-development" target="_blank" rel="noopener"&gt;Getting started with local development guide&lt;/A&gt; if you want to connect GitHub take a look at &lt;A href="https://developers.hubspot.com/docs/cms/guides/github-integration" target="_blank" rel="noopener"&gt;this guide&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 06:48:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-dynamic-header-and-footer-template/m-p/702111#M30734</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2022-10-05T06:48:10Z</dc:date>
    </item>
  </channel>
</rss>

