Plugin defined in blueprint not available

plugin
#1

Hi,

I still have a problem with defining a blueprint in my plugin. When creating a new page in the panel, my page blueprint doesn’t appear in the dropdown list.

I did this in the index.php:

    'blueprints' => [
            'pages/podcasterfeed' => __DIR__ . '/blueprints/pages/podcasterfeed.yml'
    ]

Under blueprints/pages/ there is the podcasterfeed.yml which is pretty long, so I don’t want to post it here, but you can find it here: https://github.com/mauricerenck/kirby-podcaster/blob/master/blueprints/pages/podcasterfeed.yml

The blueprint works, I created a new page and set the filename of the markdown to podcasterfeed.md in the terminal. The page appears in the panel, I can open, edit and save it.

But for the users of my plugin, I would like to skip that extra step of creating the page outside of the panel or renaming the file etc. they should be able to select it from the template selection dropdown when creating a page.

Is there anything I am doing wrong, so the template isn’t available?

0 Likes

#2

I think you have to list the available blueprints in a page blueprint. What happens if you list the blueprint thats buried in your plugin in the blue print options? My point is i dont think they show up automatically. So in your default page blue print in the normal blueprint folder (ie… not in your plugin) have you tried declaring it like this? I’m not 100% sure, but i think the plugin blueprint folder gets merged with the normal blueprint folder, so treat them as if they were in the normal folder and explicitly declare them…

title: Default

options:
  changeTemplate:
    - thenameoftheblueprintinyourplugin
0 Likes

#3

You don’t have to declare it in the changeTemplateoption, but rather the blueprint/template in a pages section has to be set to display/create pages with the template:

sections:
  mypodcastpages:
    type: pages
    headline: My podcast pages
    templates:
      - podcasterfeed
0 Likes

#4

Okay, so if I understand this right, the users of my plugin have to do so, in order to be able to use my blueprint?

0 Likes

#5

Normally, if you do not limit templates, they should all be available automatically. Let me test this.

0 Likes

#6

I have no limits set up locally and I see alle templates, but not the one of my plugin.

0 Likes

#7

Yes, I can reproduce that. That sounds like a bug. It does show up if you set the create option

sections:
  pages:
    type: pages
    create: podcasterfeed

But it should show automatically.

0 Likes

#8

Okay, that’s good to know, thank you for your help!
Should I create an issue?

0 Likes

#9

Yes, please.

0 Likes

#10

Done: https://github.com/getkirby/kirby/issues/1630
:wink:

0 Likes

#11

This should now be fixed on the develop branch and will be in 3.1.3.

1 Like