Adding dynamic data to an existing dynamic page

Hi all, I’m trying to add dynamic content to an already created dynamic page getting the data from another .yml file.

in my data folder I have this list
products.yml
portonisezionali.yml
portonibasculanti.yml
thirdcategory.yml

In the products.yml I have all the category specified with all the fields I use and I was trying by adding a variabili attribute where i was adding "<% data.portonisezionali.each do |port| %>

  • <%= port.type %>
  • <% end %>
    • nomeprodotto: ‘portoni sezionali’
      descrizione: ‘prova’
      imagehp: ‘/images/prodotti/sezionale.jpg’
      imagealt: ‘portone sezionale ryterna’
      slug_path: ‘portoni-sezionali’
      variabili: <% data.portonisezionali.each do |port| %>
    • <%= port.type %>
    • <% end %>
    • nomeprodotto: ‘portoni basculanti’
      descrizione: ‘seconda descrizione’
      imagehp: ‘/images/prodotti/basculante.jpg’
      imagealt: ‘portone basculante aesse schio’
      slug_path: ‘portoni-basculanti’
      variabili: <% data.portonibasculanti.each do |port| %>
    • <%= port.type %>
    • <% end %>

    I’m trying to this because for each category of product i have different models of product that I want to show in a list and create a page for each of them.

    In my config.rb I have this:

    data.products.each do |prod|
    proxy “#{prod.slug_path}.html”, “prodotti.html”,
    :locals => { :products => prod }
    end

    It would be fantastic if anyone can solve this problem or tell me if i’m doing something wrong

    Although I’m not a Ruby developer and my MiddleMan experience is fairly limited, I doubt your could would work because of the Yaml structure.

    Yaml is meant to a structured file format that follow a space sensitive tree model only. So you cannot add ruby code unless you append the .erb code at the end and you let MiddleMan preprocessing the file first.

    Hope that helps.