Possible to split pages and paginate them?

@texnixe and maybe @distantnative

I’m also using footnotes plugin. It’s on one page but the article is spread over two fields. Can I merge bibliographies? Now I have:

<?= KirbyFootnotes::bibliography($page->intro()) ?>
<?= KirbyFootnotes::bibliography($page->artikel()) ?>

But it creates two <ol> which both start at 1.

Just an idea, not tested:

<?php

$newField = new Field($page, null, $page->intro() . $page->article());
echo KirbyFootnotes::bibliography($newField);
?>

Or if this does not work, use $page->intro()->value() etc.

1 Like

That does a great job merging the two bibliographies. Unfortunately the numbers in the text itself still start at 1 for each field.

I don’t know for what purpose you need the intro but you could also merge the two fields for output with the footnotes in the same way? Like if you only need the intro on a listings page, but on the actual blog page both fields could be merged?

<?php
  $newField = new Field($page, null, $page->intro() . $page->article());
  echo KirbyFootnotes::field($newField, ['bibliography' => false]);
?>

Their layout and formatting is different, so they’re also in different divs. Had I foreseen this issue I might have tackled it differently (with a custom kirbytext tag maybe).

Is the intro just one paragraph? If so, you could merge the fields first, and then output the different parts by applying some regex voodoo to separate them.

I’m still looking for a way to keep my footnote numbers across multiple splitted pages, just saying :smiley:

I’m aware of that, but honestly I haven’t found a way yet. While it is pretty easy to continue the numbers across pages by using the footnotes method before splitting the stuff, I still end with the problem that after doing that the bibliography at the end does not work.

I have invited @distantnative to this thread, maybe he has an idea.

Honestly, I don’t think it is possible at the moment since the Footnotes plugin will always automatically number the notes and references. Wondering if an offset for the start could be implemented (as a parameter). But then you would also need to find out how many footnotes were present on the previous page… difficult

Well, thanks for your input. I’ll have to look for a different approach then …

I mean, I guess you could achieve it with regular expression hacks:

  • Run footnotes on the whole text
  • Split the text at the given point
  • Regex to get the number of the last in-text reference
  • Split bibliography at/remove all after the bibliography entry with the same number