page definition for home page

瀏覽次數:9 次
跳到第一則未讀訊息

Matthew Page

未讀,
2012年2月9日 下午1:17:472012/2/9
收件者:Toura Mulberry
Hi,

I am creating a simple app that contains a single custom component.
I would like my component to reside on the home page.
My scaffolded app output pages/home.md

Which looks sorta like this:

---
title: Home
page_def:
phone: home-phone
tablet: home-tablet
---

It did not output a page definitions for home. That is, the pages_defs
folder is empty.

The docs (http://mulberry.toura.com/docs/page-definitions.html) say:

"If you specify a page_def that does not exist, the page will not be
displayed in your app. If you do not specify a page_def, then the
built-in default page_def will be used."

Since the pagedef doesn't exist and I need a custom component to
reside on the page, should I just create a couple page definitions
called "home_phone" and "home_tablet"?

Thanks!

Rebecca Murphey

未讀,
2012年2月9日 下午1:21:042012/2/9
收件者:toura-m...@googlegroups.com
Yes, what you'll want to do is run:

mulberry create page_def my-page-def 

(or similar)

That will create a new file in your project's page_defs directory, which you can then edit to include your custom component. You'll need to edit your page file, too, to tell it to use that new page definition.

We're working on making this way simpler! In the meantime, though, take a peek at the Todos app's page defs, specifically https://github.com/Toura/mulberry-demos/blob/master/todos/page_defs/todos.yml, which is what's used on the home page of that app. 

Hope this helps!
--
Rebecca Murphey
Lead JavaScript Developer at Toura

Mulberry: http://mulberry.toura.com | Toura: http://toura.com
You should follow @touradev on Twitter
回覆所有人
回覆作者
轉寄
0 則新訊息