Skip to content

How to create a Landing Page

Mateus Moraes edited this page Sep 7, 2016 · 3 revisions
  1. Create a slim file inside the proper folder (usually landingpages).

  2. Open routes.rb and add a new route for the landing page:

get '/super-landing-page' => 'products/collections#show', :permalink => 'super-landing-page', :as => :super_landing_page

  1. Create a blank migration file through the terminal:

bundle exec rails g migration create_super_landing_page

  1. Edit /website/db/migrate/<name of the new migration file>.rb

This is the migration file, needed to automate the page creation in the CMS.

You may follow something like this file.

In this file, you'll just need to edit the lookbook properties you want, located inside the #landing_page_properties method.

  1. Run your migration:

bundle exec rake db:migrate

  1. Check if your landing page opens with the new URL.

Notes and workarounds

  • If something went wrong with the db migration you may revert that in the Terminal:

bundle exec rake db:rollback

  • If the URL shows a 404 error then probably the page is not published in the CMS. You may need to go to the admin area and check that.

  • PIDs from Production and Staging environments may differ from your Local's. If something explodes try removing the PIDs from the admin area.