# Hanami 1.3 \> Hanami 2.2 : tips & notes about my journey

**URL:** <https://discourse.hanakai.org/t/hanami-1-3-hanami-2-2-tips-notes-about-my-journey/1210>\
**Category:** sharing\
**Created:** [May 19, 2025, 10:52am UTC](https://discourse.hanakai.org/t/hanami-1-3-hanami-2-2-tips-notes-about-my-journey/1210 "2025-05-19T10:52:23Z")\
**Posts on this page:** 1\
**Showing post:** 33

<div class="post-metadata">

**Author:** ![inouire](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.hanakai.org/inouire/32/816_2.png) [@inouire](https://discourse.hanakai.org/u/inouire)\
**Post date:** [April 28, 2026, 3:34pm UTC](https://discourse.hanakai.org/t/hanami-1-3-hanami-2-2-tips-notes-about-my-journey/1210/33 "2026-04-28T15:34:05Z")

</div>

**Use case #12: Easily customizing page parameters**

My initial reflex while trying to set dynamic / nav parameters of the page (like a title, breadcrumbs..) was to use layout-level exposures in the views: `expose :title, :layout => true`

While technically possible, I found it a bit tedious to do, because in fact it made more sense to live inside the template itself, which receives all the useful information ready to use.

**This is possible very easily thanks to the context method `content_for`**  
[Views / Context · Hanami v2.3 · Hanakai](https://hanakai.org/learn/hanami/v2.3/views/context#standard-context)

That way, you can set a dynamic information from any template:

```html
<!-- templates/catalog/configuration.html.erb -->
<% content_for :title, "Configure catalog #{catalog.name}" %>

<div>
   <h1>Catalog configuration / <%= catalog.name %></h1>
</div>

```

And then use it from the layout, or any other template:

```html
<!-- templates/layout/app.html.erb -->
<html>
  <head>
    <title><%= content_for :title %></title>
  </head>
  <body>
    <%= yield %>
  </body>
</html>

```

In my example, this will render:

```html
<html>
  <head>
    <title>Configure catalog Foo</title>
  </head>
  <body>
    <div>
      <h1>Catalog configuration / Foo</h1>
    </div>
  </body>
</html>

```

Very simple, very powerful. I wished I’d knew it earlier 😅  
Happy coding ! 🌸🌞

---

_[View the full topic](https://discourse.hanakai.org/t/hanami-1-3-hanami-2-2-tips-notes-about-my-journey/1210)._
