apostrophe icon indicating copy to clipboard operation
apostrophe copied to clipboard

sub classing fancy pages *editted

Open dannyblv opened this issue 11 years ago • 6 comments

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

dannyblv avatar Apr 05 '15 11:04 dannyblv

any clue ? I tried to look at blog-2 but I can't see what I am missing..

@boutell

dannyblv avatar Apr 06 '15 09:04 dannyblv

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.

boutell avatar Apr 06 '15 11:04 boutell

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.

boutell avatar Apr 06 '15 11:04 boutell

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 ?

dannyblv avatar Apr 06 '15 11:04 dannyblv

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

boutell avatar Apr 06 '15 12:04 boutell

This feature will be supported in 0.6, we don't have plans to backport it. Closing issue.

jth- avatar Feb 01 '16 15:02 jth-