2

I want to change the way a post list is rendered in Telescope based off a property of a category that its in. I.e. One category is a ListView when another is a GridView.

I tried:

Categories.addField({
  fieldName: 'gridType',
  fieldSchema: {
  type: Number,
  optional: true,
  autoform: {
      omit: true
    }
  }
});

The issue is Im not seeing the property added, I also noticed in the documentation that this was intended for Posts, Users, Comments ect but I'm guessing it should work.

The reason I do not think its working is it's now showing up on the create Category Form

Christian Fritz
  • 20,641
  • 3
  • 42
  • 71
user3006981
  • 177
  • 8
  • could you explain again what you are trying to accomplish? It's not clear from your question, at least to me. What is `Categories` and where do you define the `addField` function, and where is this being used? – Christian Fritz Aug 30 '15 at 21:57
  • Its a very telescope specific question. addField is a prototype of the Mongo.Collection and Categories are an object part of telescope. I ended up forking the repo and making all the modifications I want. Still curious if there is a way to do what im trying to do. – user3006981 Aug 31 '15 at 00:06
  • oh, i see. Sorry, I didn't realize that and hadn't paid attention to the tag. I added some text to clarify that. – Christian Fritz Aug 31 '15 at 00:19

1 Answers1

1

You need to remove the autoform:{omit: true}. It mentions in the docs that if you want to hide it from the forms you should pass the omit option, otherwise you can leave it out.

Also, be sure to add this in a file that's accessible on both the client and the server, otherwise you'll see it in the schema on the client with Categories.simpleSchema()._schema but it'll have to persist on the server.

Aram Kocharyan
  • 20,165
  • 11
  • 81
  • 96