Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global layout data not working #1

Closed
janherman opened this issue Dec 23, 2021 · 2 comments · Fixed by #2
Closed

Global layout data not working #1

janherman opened this issue Dec 23, 2021 · 2 comments · Fixed by #2
Assignees

Comments

@janherman
Copy link

I tried to pass some data to the layout method, but I get "Undefined variable" error every time.

My template:
/site/templates/default.php

<?php layout("default", ["title" => "Some title"]) ?>

<p>Some content...</p>

Layout:
/site/layouts/default.php

<?= $title ?>

<?php slot() ?>
<?php endslot() ?>

Latest version of Kirby Plainkit, no other plugins installed.

@afbora
Copy link
Member

afbora commented Dec 23, 2021

Did you try in slots? Like that:

<?php slot() ?>
  <?= $title ?>
<?php endslot() ?>

@janherman
Copy link
Author

Yes, I tried that. Unfortunately it does not work either.

@afbora afbora self-assigned this Dec 23, 2021
afbora added a commit that referenced this issue Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants