How do I customise telescope-base?

993 views Asked by At

In the open source example http://www.telesc.pe/, how do I remove digest and daily view items from the view menu? Do I need to modify telescope-base?

2

There are 2 answers

0
Sacha On BEST ANSWER

You need to create a new package to hold your customizations. You can look at the Telescope documentation, look at existing theme packages such as base and hubble, or copy and adapt the telescope-blank package.

Once you have your new package, you can simply overwrite the viewNav menu. For example:

viewNav = [
  {
    route: 'posts_top',
    label: 'top'
  },
  {
    route: 'posts_new',
    label: 'new'
  },
  {
    route: 'posts_best',
    label: 'best'
  }
];

The daily view is provided by another package, telescope-daily, so you'll need to remove it from the app if you don't want to use it:

meteor remove telescope-daily

(Note that the digest view will also be extracted out as its own package eventually, but right now it's still part of the core)

4
saimeunt On

You can try this :

Create a config.js under client/ and put the following code inside :

while(viewNav.length > 0){
  viewNav.pop();
}

viewNav.push({
  route: 'posts_top',
  label: 'Top'
});
// etc...

This will load after telescope-base which is responsible for exporting viewNav an array used to control which items are inserted in the menu.