lukaskleinschmidt / kirby-sortable

Making subpage managing a breeze
79 stars 6 forks source link

Hide page in module section #48

Closed findthebug closed 6 years ago

findthebug commented 6 years ago

I have updated the modules and sortable plugin to the latest version. So far all is working but one thing i can't get done. In the Panel on the right side where the modules are diplayed, also the normal page are shown. how can i disable the normal pages in the sortable section? in the old version of modules and sortable plugin, normal pages are hidden in the module section on the right side. do i miss something?

bildschirmfoto 2018-04-17 um 13 34 33

lukaskleinschmidt commented 6 years ago

How does your blueprint file look like? Are you using the modules or the sortable field type?

findthebug commented 6 years ago

At the moment im testing it on the projects template with the sortable field type. I did the basic kirby installation and added just the sortable default definition to the blueprint.

Toolkit Version: 2.5.10 Kirby Version: 2.5.10 Panel Version: 2.5.10

projects.yml

title: Projects
files: true
options:
  preview: true
  status: true
  template: true
  url: true
  delete: true  
pages:
  hide: false
  template:
    - module.text
    - module.gallery 
fields:
  title:
    label: Title
    type:  text
  sortable:
    label: Sortable
    type:  sortable
    sortable: true
    layout:  base
    variant: null
    limit: false
    parent: null
    prefix: null
    options:
      limit: false

Here is the basic installation to reproduce the behaviour. login/pw root/root kirby.zip

lukaskleinschmidt commented 6 years ago

Please try to use the modules field type. Both fields ship with this plugin. The modules field itself is an extended sortable field and overrides the prefix and parent options. This way the plugin knows which pages it should handle.

Your blueprint should look like this.

title: Projects
files: true
options:
  preview: true
  status: true
  template: true
  url: true
  delete: true  
pages:
  hide: false
  template:
    - module.text
    - module.gallery 
fields:
  title:
    label: Title
    type: text
  modules:
    label: Modules
    type: modules

Basically you could also use the sortable field if you set the prefix and parent option accordingly.

findthebug commented 6 years ago

I tried that before but then the modules are displayed on the left side under "Seiten" and on the right side is shown "The parent page could not be found".

As you can see on the screenshot the title "modules" is on top of "Title". Maybe a Version problem?

bildschirmfoto 2018-04-17 um 17 13 57

lukaskleinschmidt commented 6 years ago

It looks like you are using modules without the modules page wrapper. Did you configure the modules plugin accordingly?

You would neet to set c::set('modules.parent.uid', ''); like this to make modules work without the wrapper page.

findthebug commented 6 years ago

Okay that was the problem, i missed that option. But now the modules itself appears on the left side under the normal pages section. how can i hide it from that list? Thanks for you help!

bildschirmfoto 2018-04-17 um 18 03 38

lukaskleinschmidt commented 6 years ago

You would need to set hide: true in each module blueprint.

findthebug commented 6 years ago

Perfect. Now all is perfect. Thank you for the help and the great plugin!