mongodbmeteortelescope

Override Schema defined in Telescope(Meteor)


I am currently customizing Telescope heavily, which is written in Meteor.

I need to go over the 3,000 character defined in Telescope's Posts schema's body defined here in the source.

I've been able to customize the HTML and JS, but not the models. How would I do so?


Solution

  • Just create a file under your lib folder and use the documentation here: http://docs.telescopeapp.org/docs/custom-fields to remove or add fields to that Schema.

    EDIT: Sorry, but reading carefully your comment I understood you want to modify the autoForm props rather than the Schema itself. To change the maximum allowed value, do something along these lines:

    Posts.removeField("body");
    Posts.addField({
      fieldName: 'body',
      fieldSchema: {
        type: String,
        optional: true,
        max: 5000,
        editableBy: ["member", "admin"],
        autoform: {
          placeholder: 'Cannot exceed the maximum length of 5000 characters',
          row: 10,
          type: 'textarea'
        }
      }
    });