lundi 1 juillet 2019

How do I customize a view generated by a Comfy CMS Page?

In my Rails 3.2 app, I am using comfortable_mexican_sofa 1.8.

I have created some 'CMS Pages' within the CMS admin (some static pages like 'About Us', 'Contact Us', etc.). All of these pages are populated by the fields within the CMS Admin section.

But I can't figure out how to customize the template so that it renders the about us correctly.

Here is the log:

Started GET "/about" for 127.0.0.1 at 2019-07-01 01:42:05 -0500
Processing by CmsContentController#render_html as HTML
  Parameters: {"cms_path"=>"about"}
   (1.3ms)  SELECT COUNT(*) FROM "admins" WHERE (admins.superadmin = 't')
   (0.7ms)  SELECT COUNT(*) FROM "cms_sites" 
  Cms::Site Load (0.4ms)  SELECT "cms_sites".* FROM "cms_sites" LIMIT 1
  Cms::Page Load (1.5ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."site_id" = 1 AND "cms_pages"."is_published" = 't' AND "cms_pages"."full_path" = '/about' ORDER BY cms_pages.position LIMIT 1
  Cms::Layout Load (0.8ms)  SELECT "cms_layouts".* FROM "cms_layouts" WHERE "cms_layouts"."id" = 5 ORDER BY cms_layouts.position LIMIT 1
  Cms::Block Load (1.0ms)  SELECT "cms_blocks".* FROM "cms_blocks" WHERE "cms_blocks"."page_id" = 9 AND "cms_blocks"."identifier" = 'blurb' LIMIT 1
  Cms::Page Load (0.8ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."id" = 9 ORDER BY cms_pages.position LIMIT 1
  CACHE (0.0ms)  SELECT "cms_layouts".* FROM "cms_layouts" WHERE "cms_layouts"."id" = 5 ORDER BY cms_layouts.position LIMIT 1
  Cms::Layout Load (0.8ms)  SELECT "cms_layouts".* FROM "cms_layouts" WHERE "cms_layouts"."id" = 2 ORDER BY cms_layouts.position LIMIT 1
  Cms::Block Load (1.3ms)  SELECT "cms_blocks".* FROM "cms_blocks" WHERE "cms_blocks"."page_id" = 9
  Rendered inline template (1.5ms)
  Rendered partials/cms/pages/_header.html.haml (78.3ms)
  Cms::Page Load (0.7ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."id" = 1 ORDER BY cms_pages.position LIMIT 1
  Rendered inline template within layouts/cms_inside (108.3ms)
  Cms::Page Load (1.3ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."site_id" = 1 AND (parent_id IS NULL) ORDER BY cms_pages.position LIMIT 1
  Cms::Page Load (0.7ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."parent_id" = 1 AND "cms_pages"."is_published" = 't' ORDER BY cms_pages.position OFFSET 1
  Rendered shared/_navbar.html.erb (13.5ms)
  Cms::Snippet Load (1.2ms)  SELECT "cms_snippets".* FROM "cms_snippets" WHERE "cms_snippets"."site_id" = 1 AND "cms_snippets"."identifier" = 'footer_contact' ORDER BY cms_snippets.position LIMIT 1
  Rendered inline template (1.5ms)
  Rendered shared/_footer.html.erb (13.6ms)
Completed 200 OK in 386.2ms (Views: 324.8ms | ActiveRecord: 12.5ms)

I don't have an 'about' path declared in my routes.rb, nor an about_controller and therefore I don't have a app/views/cms/pages/about.html.erb or anything like that.

I do have things like layouts/cms_inside which renders correctly, but it has a yield block that just renders the data collected from the text fields in the CMS Admin.

I have checked the documents at the GH repo, but it isn't clear about how to customize these generated pages.

Thoughts?

Aucun commentaire:

Enregistrer un commentaire