Landing Page Content updating

I am starting to work on the static landing page feature in our Open Source Development environment. I have my config.yml configured with:

  clp_static_enabled: true
  clp_static_released_version: 3
  clp_cache_time: 900
  show_landing_page_admin: true
  custom_landing_page_marketing_site_url: "http://www.example.com/landingpage/"

The landing page is loading without an issue. Initially I was able to change the background image and reduce the number of sections to 3. However, now, when I go into /app/services/custom_landing_page and edit example_data.rb, I don’t see the changes reflected on the page no matter what I do. I have tried:

  • restarting the server
  • restarting the jobs:worker thread
  • running “bundle install”
  • incrementing the “clp_static_released_version” in config.yml to prevent caching

But nothing works. My current example_data.rb is as follows:

 module CustomLandingPage
  module ExampleData


    DATA_STR = <<JSON
{
  "settings": {
    "marketplace_id": **{Redacted}**,
    "locale": "en",
    "sitename": "Adfresco"
  },

  "page": {
    "twitter_handle": {"type": "marketplace_data", "id": "twitter_handle"},
    "twitter_image": {"type": "assets", "id": "default_hero_background"},
    "facebook_image": {"type": "assets", "id": "default_hero_background"},
    "title": {"type": "marketplace_data", "id": "page_title"},
    "description": {"type": "marketplace_data", "id": "description"},
    "publisher": {"type": "marketplace_data", "id": "name"},
    "copyright": {"type": "marketplace_data", "id": "name"},
    "facebook_site_name": {"type": "marketplace_data", "id": "name"},
    "google_site_verification": {"value": "CHANGEME"}
  },

  "sections": [
    {
      "id": "hero",
      "kind": "hero",
      "variation": {"type": "marketplace_data", "id": "search_type"},
      "title": {"type": "marketplace_data", "id": "slogan"},
      "subtitle": {"type": "marketplace_data", "id": "description"},
      "background_image": {"type": "assets", "id": "default_hero_background"},
      "background_image_variation": "light",
      "search_button": {"type": "translation", "id": "search_button"},
      "search_path": {"type": "path", "id": "search"},
      "search_placeholder": {"type": "marketplace_data", "id": "search_placeholder"},
      "search_location_with_keyword_placeholder": {"type": "marketplace_data", "id": "search_location_with_keyword_placeholder"},
      "signup_path": {"type": "path", "id": "signup"},
      "signup_button": {"type": "translation", "id": "signup_button"},
      "search_button_color": {"type": "marketplace_data", "id": "primary_color"},
      "search_button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
      "signup_button_color": {"type": "marketplace_data", "id": "primary_color"},
      "signup_button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"}
    },
    {
      "id": "three_column_info_without_icons_and_buttons",
      "kind": "info",
      "variation": "multi_column",
      "title": "Welcome to the power of Adfresco. See why we're valuable to all partners!",
      "columns": [
        {
          "title": "Brands",
          "paragraph": "Sometimes Marketing budgets aren't large enough to support an agency partner. Adfresco connects Media Sellers and their offerings directly to brands so they can advertise on the channels that make the most sense for them."
        },
        {
          "title": "Agencies",
          "paragraph": "Media needs aren't always simple. Sometimes you need a complex, omni-channel package, versus straight inventory. Use our Media Request feature to post an RFP for **exactly** what you need, and let the sellers build you a package."
        },
        {
          "title": "Media Owners",
          "paragraph": "Selling to your contact list is effective, until it isn't. When that happens where do you go? How do you get the word out about your valuable offering? Let us help with our 22K+ Media & Advertising social network!"
        }
      ]
    },
    {
      "id": "footer",
      "kind": "footer",
      "theme": "dark",
      "social_media_icon_color": {"type": "marketplace_data", "id": "primary_color"},
      "social_media_icon_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
      "links": [
        {"label": "About", "href": {"type": "path", "id": "about"}},
        {"label": "Contact us", "href": {"type": "path", "id": "contact_us"}},
        {"label": "How to use?", "href": {"type": "path", "id": "how_to_use"}},
        {"label": "Privacy", "href": {"type": "path", "id": "privacy"}},
        {"label": "Invite new members", "href": {"type": "path", "id": "new_invitation"}},
      ],
      "social": [
        {"service": "facebook", "url": "https://www.facebook.com/Sharetribe/"},
        {"service": "twitter", "url": "https://twitter.com/sharetribe"},
        {"service": "linkedin", "url": "https://www.linkedin.com/company/2626583"},
      ],
      "copyright": "Copyright Adfresco Media Group, LLC 2017"
    }
  ],

  "composition": [
    { "section": {"type": "sections", "id": "hero"}},
    { "section": {"type": "sections", "id": "three_column_info_without_icons_and_buttons"}},
    { "section": {"type": "sections", "id": "footer"}}
  ],

  "assets": [
    { "id": "default_hero_background", "src": "KeepingMediaHuman.jpg", "content_type": "image/jpeg" }
  ]
}

JSON

  end
end

Can anyone see any issues with my landing page code? Do I need to run another command? Not sure why some changes worked, and others aren’t. Is there something else I need to check related to caching? I can’t figure out what the issue is here! Any help is very much appreciated!

Thank you!

Rob

All,

I figured out my problem. It was a syntax issue in the example_data.rb file. All fixed. Watch out for those {, [, and commas!

Also, another key learning, I was saving backups in the same directory but Ruby parses everything so my backups were stepping on each other. Save your backup example_data.rb files in a folder outside of the Ruby project (FYI).

-rb

Hello Rob,

I have the same issue with example_data.rb file. On production I replaced 2020 with 2021 but with no result. I run puma. On staging site it worked. Also I copied example_data.rb from my backup but not helped. A year ago it worked. Maybe issue in some configure files. It seems that something is blocking commit changes. Can you give me any advice?
Thank you.