Jump to content

data page with multiple templates


PeterDK
 Share

Recommended Posts

Right now I have a page holding 'data' (rental prices) I keep it separate because i want to edit this in one place and use it 8 times (4 languages, 2 presentation (list, selectable))

Right now I'm using Hanna code to create a 'template' for this code (see github).

I don't feel right about this solution. Can I use this one page with multiple templates?

And in the page that I use instead of calling [[Hanna code]] use $pages->get('data')->render(with template nr 8)?

Link to comment
Share on other sites

Right now I have a page holding 'data' (rental prices) I keep it separate because i want to edit this in one place and use it 8 times (4 languages, 2 presentation (list, selectable))

I'm unclear about why you are using Hanna code for this. I might not be understanding the question, but it sounds like something that maybe you should just be using pages for. For instance, you could have a page called /tools/rental-prices/, and output that:

echo $pages->get('/tools/rental-prices/')->body; 

If you had various different options for rental prices, then you could create a 'page reference' field called rental_prices, and make it select from one of the many pages living under /tools/rental-prices/, like /tools/rental-prices/summer/ and what not. Then you'd output it like this:

echo $page->rental_prices->body;  
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...