sub classing fancy pages *editted
hey, how can I sub-class facnyPages or override it ? so i'll have default feild schemas for every extend ? (like how the tags and title works) ..
I tried it this way, same as I subclassing snippets http://pastebin.com/yWYPS9BX and I called it this way,
'home': {
extend: 'apostrophe-languages',
name: 'home',
label: 'Home',
addFields: [
{
name: 'incorporated',
label: 'test!',
type: 'integer'
}
]
}
in the app.js (as a module)
and I do get the console.log for options.addFields and this is the result
addFields [ { name: 'test', label: 'Test', type: 'string' } ] addFields [ { name: 'test', label: 'Test', type: 'string' }, { name: 'incorporated', label: 'test!', type: 'integer' } ]
but in the page settings I dont see them, not sure what I'm doing wrong.
thanks
any clue ? I tried to look at blog-2 but I can't see what I am missing..
@boutell
There is not currently a way to do this. It will be easy and standard in 0.6/1.0 (which is still a few months from being useful in production). We're looking at whether it's practical to backport that to 0.5.
In the meantime you could use apostrophe-fancy-pages for every page type and use a require statement to pull in part of your addFields to make that less verbose, etc.
Aww bad news .. well, if atm I create them as apostrophe-fancy-pages I'd be able to change the extends to my new module without losing any piece of data ?
I'm not sure what you're asking.
I'm suggesting that you subclass apostrophe-fancy-page to make a module for each one.
On Mon, Apr 6, 2015 at 7:54 AM, Danny Braunstein [email protected] wrote:
Aww bad news .. well, if atm I create them as apostrophe-fancy-pages I'd be able to change the extends to my new module without losing any piece of data ?
— Reply to this email directly or view it on GitHub https://github.com/punkave/apostrophe/issues/228#issuecomment-90027635.
*THOMAS BOUTELL, *DEV & OPS P'UNK AVENUE | (215) 755-1330 | punkave.com
This feature will be supported in 0.6, we don't have plans to backport it. Closing issue.