Ideally I’d like to define this with some PHP logic, like check if this page actually needs to have this button or not.
Ignoring the need for some logic for now I tried to add the button through the blueprint, but using something like link: "{{page.url}}/?parameter=test is not possible. And in the config.php method does not seem to be working either.
What is the best method you would recommend using to add a dynamic URL in a panel view button like that?
Just to make sure, you are using beta.2 not beta.1?
For the logic part, I’d recommend defining the button via a custom Panel area (see section on Panel view buttons | Kirby CMS). There you can add your conditions. And then reference it by name in your blueprint.
Must admit that I don’t understand that example with the area, if I want the button in a page, why would I define it in a custom todos area? Wouldn’t it have to go into a page view?
Basti and I talked about it a little that it’s not always ideal where we placed our extension. But like dialogs, drawers and dropdowns, we implemented buttons also to be defined as part of an area. You could also extend the default site area with it. In the end it doesn’t matter much for buttons as we look them up in any area and the config when you reference them by name.
I think in a future version, we will also allow defining dialogs, drawers, buttons etc. without an area in the first place. But for now I thought it’s best to keep it consistent with the rest.
Did not see there a beta2 released today. Updating now.
I agree with @texnixe, as you can see I did not mention the 3rd method listed in the documentation page because I honestly did not understand the example and wanted to make sure there was indeed no way to make it work with the 2 previous ones.
Just to be clear the last example you gave is supposed to be solely used in the config.php or can it be used in the index.php of a plugin also?