Menu
  • < Back to site
  • Changelogs
  • Technical Blog
  • Support Forum

Search the Homeflow API Documentation

x
  • Getting started
    • Intro
    • Theme folder structure
    • The layout file
    • Asset packs
    • Building up the layout
    • Running your theme
    • Live releases and speed
  • Admin CMS (Logos)
    • Admin CMS
  • Agencies
    • Intro
    • The agency show page
    • Properties from fragment
    • Agency featured properties
    • Agency recent sales and lettings
    • Interesting properties
    • Testimonials
    • Banners
  • Application & homepage
    • Intro
    • Page titles and descriptions
    • The header
    • The navigation menu
    • The carousel
    • Custom theme colours
    • CSS pre-processors
    • The footer
    • Sidebars
    • Flash messages
  • Array helpers
    • Array helpers
  • Articles
    • Articles loop
    • Articles index
    • Articles show
    • Articles topics and functions
    • Infinite scroll
  • Assets
    • Assets and Minify
    • Fonts
  • Best practices
    • Intro
    • Intelligent Code Design
    • Homeflow Lint
    • Working with Images
    • Queuing and deferring JavaScripts
    • Custom CSS
    • Child Themes
    • Content Chunks
    • Theme Config.yml
    • Problem Solving
  • Branches
    • Working With Branches
    • The branches index
    • Branch searching
    • Branch titles and pagination
    • The branch show page
    • Displaying branch properties
    • Branch recent sales and lettings
  • Cookie consent
    • Add cookie consent
  • Drops
    • Intro
    • Agency Drop
    • Article Drop
    • Banner Drop
    • Banner Menu Item Drop
    • Branch Drop
    • Carousel Item Drop
    • Location Drop
    • Menu Drop
    • Menu Item Drop
    • Node Drop
    • Page Drop
    • Pagination Drop
    • Portal Drop
    • Property Drop
    • Search Drop
    • Staff Member Drop
    • Testimonial Drop
    • Local Business Data Drop
    • Property Facets Drop
  • Events
    • Intro
    • Toggles
    • Map events
    • Saving Properties
    • Saved Searches
    • Users
    • Views
    • Misc
  • Forms (Custom)
    • Intro
    • Form fields
    • File uploads
    • Client Bookings
    • Form Templates
  • Lead forms
    • Intro
    • Property leads
    • Branch enquiry lead
    • Staff enquiry lead
    • Register form
    • Valuation form
    • Validation
    • Custom Lead Forms
    • Spam
  • Location guides
    • Location guides
    • Location guide show
  • Local Business Data
    • Intro
    • Liquid Methods and Available Data
    • Editing Local Data in Logos
  • Maps
    • Intro
    • Property show maps
    • Branch maps
    • Draw a map
    • Custom map pins
    • Custom property pins
    • Custom branch pins
  • Nodes
    • Intro
    • What is a node
    • Adding a node
    • Rendering nodes to a page
    • Property results location blocks
    • Property pages
  • Pages
    • Intro
    • Featured pages
    • The show page
    • Related pages
    • Content blocks
    • Theme content blocks
    • Multiple content blocks
    • Geo Content blocks
    • Alternative page layouts
  • Property searching
    • Property search form
    • Search disambiguation
    • Geolocate Search
  • Property results
    • Displaying search results
    • The properties loop
    • Locations and postcodes
    • Headings and pagination
    • More on pagination
    • Togglable areas
    • Working with map views
    • Working with grid views
    • Sorting property results
    • Saving to a shortlist
    • Saving searches
    • Infinite scrolling
    • Infinite scroll options
  • Property show page
    • Intro
    • The tabbing system
    • Outputting basic information
    • Submitting a lead
    • Working with video
    • Similar properties
    • Send to Friend
    • Next and previous properties
    • Most recent search template
    • Print property
    • Letting fee text
    • Development plots
  • Staff
    • Working With Staff
    • Add/query basic information
    • Staff by channel
  • Theme configuration options
    • Intro
    • Prices
    • Config YAML
    • Sample YAML file
    • Custom Flash Messages
  • User profile system
    • Intro
    • Getting started
    • Alternative user profile tech
    • Download the core templates
    • Paired Househunting
  • Valuations (Instant)
  • Appendix
    • Hestia URLs
    • Application Assets
    • Social media functions
    • Draw a Map base styles
    • Theme Colours
  • Homeflow API gem
    • Intro
  • 404s
    • Handling errors and 404s

Add cookie consent

To add the cookie consent popup to a theme, follow these steps.

If a theme already contains the include for the cookie_directive partial, remove it:

  
    {% include 'layouts/cookie_directive' %} <-- remove this
  

Add cookie_consent to both the theme’s vendor javascripts and stylesheets sections of config.yml (make sure you add the javascript pack after the ctesius and asset_pack theme scripts, and the stylesheet pack before asset_pack):

    
      vendor_assets:
          javascripts:
            - ctesius
            - asset_pack
            - cookie_consent
          stylesheets:
            - ctesius
            - cookie_consent
            - asset_pack
    
  

Add to the themes <head> (be sure to remove if this is already in the theme!)

Add to the bottom of the body element (and remove if this already exists).

The cookie consent code assumes that all third-party scripts will be coming from head_analytics_code and analytics_code from the agency’s admin preferences, therefore you should search the theme for any hardcoded third-party scripts or content blocks that may include third party scripts (like a google_tag_manager content block) and move the code into the analytics sections of the agent’s admin, e.g. https://a1propertyuk.homeflow.co.uk/configure/website/appearance/preferences

To customise the cookie consent popup, use the wizard on this page to configure: https://www.osano.com/cookieconsent/download/ then carefully copy the configuration object (the thing inside parentheses that starts with { and ends with } - do not copy everything!) from inside the provided code and put it inside a content chunk named cookie_consent_config - be careful not to introduce any syntax errors as the content must be a valid JavaScript object.

The content of the content chunk might look like this:

    
      {
        "palette": {
          "popup": {
            "background": "#000"
          },
          "button": {
            "background": "#f1d600"
          }
        },
        "position": "bottom-left",
        "type": "opt-in",
        "content": {
          "message": "This website uses cookies to give you the best experience.",
          "href": "/pages/cookie-policy"
        }
      }
    
  

This is the default if no content chunk is set (in case you only want to customise parts) - this uses Liquid to make the colours dynamic:

    
      {
        "palette": {
          "popup": {
            "background": "#edeff5",
            "text": "#838391"
          },
          "button": {
            "background": "transparent",
            "text": "{{ theme_preferences.button_tint_colour }}",
            "border": "{{ theme_preferences.button_tint_colour }}"
          },
        },
        "position": "bottom-left",
        "type": "opt-in",
        "content": {
            "href": "/pages/cookie-policy",
            "message": "This website uses cookies to give you the best experience.",
        }
      }
    
  

You can also HIDE the cookie completely by pasting this JSON into the above content chunk:

{ "do_not_show": true }

If you want to cookie popup to appear in the middle of the screen, with a grey background blocking the user from interacting with the page until they have accepted or declined cookies, add "theme": "fullscreen" to the object, e.g.

    
      {
        "theme": "fullscreen",
        "palette": {
        ...etc
    
  

For any page specific third-party scripts that are hard coded within the theme, wrap the script using the following if statement in liquid:

  
    {
    {% if cookies_accepted %}
      
    {% endif %}
  
  • Getting started
    • Intro
    • Theme folder structure
    • The layout file
    • Asset packs
    • Building up the layout
    • Running your theme
    • Live releases and speed
  • Admin CMS (Logos)
    • Admin CMS
  • Agencies
    • Intro
    • The agency show page
    • Properties from fragment
    • Agency featured properties
    • Agency recent sales and lettings
    • Interesting properties
    • Testimonials
    • Banners
  • Application & homepage
    • Intro
    • Page titles and descriptions
    • The header
    • The navigation menu
    • The carousel
    • Custom theme colours
    • CSS pre-processors
    • The footer
    • Sidebars
    • Flash messages
  • Array helpers
    • Array helpers
  • Articles
    • Articles loop
    • Articles index
    • Articles show
    • Articles topics and functions
    • Infinite scroll
  • Assets
    • Assets and Minify
    • Fonts
  • Best practices
    • Intro
    • Intelligent Code Design
    • Homeflow Lint
    • Working with Images
    • Queuing and deferring JavaScripts
    • Custom CSS
    • Child Themes
    • Content Chunks
    • Theme Config.yml
    • Problem Solving
  • Branches
    • Working With Branches
    • The branches index
    • Branch searching
    • Branch titles and pagination
    • The branch show page
    • Displaying branch properties
    • Branch recent sales and lettings
  • Cookie consent
    • Add cookie consent
  • Drops
    • Intro
    • Agency Drop
    • Article Drop
    • Banner Drop
    • Banner Menu Item Drop
    • Branch Drop
    • Carousel Item Drop
    • Location Drop
    • Menu Drop
    • Menu Item Drop
    • Node Drop
    • Page Drop
    • Pagination Drop
    • Portal Drop
    • Property Drop
    • Search Drop
    • Staff Member Drop
    • Testimonial Drop
    • Local Business Data Drop
    • Property Facets Drop
  • Events
    • Intro
    • Toggles
    • Map events
    • Saving Properties
    • Saved Searches
    • Users
    • Views
    • Misc
  • Forms (Custom)
    • Intro
    • Form fields
    • File uploads
    • Client Bookings
    • Form Templates
  • Lead forms
    • Intro
    • Property leads
    • Branch enquiry lead
    • Staff enquiry lead
    • Register form
    • Valuation form
    • Validation
    • Custom Lead Forms
    • Spam
  • Location guides
    • Location guides
    • Location guide show
  • Local Business Data
    • Intro
    • Liquid Methods and Available Data
    • Editing Local Data in Logos
  • Maps
    • Intro
    • Property show maps
    • Branch maps
    • Draw a map
    • Custom map pins
    • Custom property pins
    • Custom branch pins
  • Nodes
    • Intro
    • What is a node
    • Adding a node
    • Rendering nodes to a page
    • Property results location blocks
    • Property pages
  • Pages
    • Intro
    • Featured pages
    • The show page
    • Related pages
    • Content blocks
    • Theme content blocks
    • Multiple content blocks
    • Geo Content blocks
    • Alternative page layouts
  • Property searching
    • Property search form
    • Search disambiguation
    • Geolocate Search
  • Property results
    • Displaying search results
    • The properties loop
    • Locations and postcodes
    • Headings and pagination
    • More on pagination
    • Togglable areas
    • Working with map views
    • Working with grid views
    • Sorting property results
    • Saving to a shortlist
    • Saving searches
    • Infinite scrolling
    • Infinite scroll options
  • Property show page
    • Intro
    • The tabbing system
    • Outputting basic information
    • Submitting a lead
    • Working with video
    • Similar properties
    • Send to Friend
    • Next and previous properties
    • Most recent search template
    • Print property
    • Letting fee text
    • Development plots
  • Staff
    • Working With Staff
    • Add/query basic information
    • Staff by channel
  • Theme configuration options
    • Intro
    • Prices
    • Config YAML
    • Sample YAML file
    • Custom Flash Messages
  • User profile system
    • Intro
    • Getting started
    • Alternative user profile tech
    • Download the core templates
    • Paired Househunting
  • Valuations (Instant)
  • Appendix
    • Hestia URLs
    • Application Assets
    • Social media functions
    • Draw a Map base styles
    • Theme Colours
  • Homeflow API gem
    • Intro
  • 404s
    • Handling errors and 404s
  • Twitter
  • Facebook
  • LinkedIn
  • Google Plus

© Copyright 2014