2

I have created 1000 joomla articles via console import (It was a migration from other source). Everything is working fine (Tagging, Intro-Text, Custom fields and so on) but i have a problem with system pagebreaks.

The system pagebreak and the introtext is working in the same way: inserting special <hr> elements in the texts, like:

<!-- introtext -->
<hr id="system-readmore" />
<!-- system pagebreak -->
<hr title="2" alt="2" class="system-pagebreak" />

The "system-readmore" is working great but the "system-pagebreak" is not working correctly. The "system-pagebreak" are outputted in frontend as real <hr> elements. If i go to backend, open the article and just save it - after that it works. So after console import of the article the <hr> are inserted correctly but i have to manually save the article in backend to get them to work.

There must be a identifier or something i am missing. I thought it is just like the "system-readmore" but it isn't.

Does someone know what i am missing, i checked the debugger of joomla but cant find a hint.

1
  • Thank you for posting your Joomla question on JSE. Please take our tour while you wait for feedback. Dec 10, 2020 at 20:49

1 Answer 1

4

Solution was quiet simple. It was a self-closing HTML element issue:

If you face the same problem, check that your programmatically inserted <hr> system pagebreaks have a closing slash:

<-- CORRECT -->
<hr title="2" alt="2" class="system-pagebreak" />

<-- WILL NOT WORK -->
<hr title="2" alt="2" class="system-pagebreak">

In HTML5 generally this is no issue but the joomla core pagebreak plugin uses the following regex to determine if it is a system pagebreak or not:

// plugins/content/pagebreak/pagebreak.php:67

$regex = '#<hr(.*)class="system-pagebreak"(.*)\/>#iU';
2
  • Good that you’ve found the answer and solved it! In your question however the closing tag was already correct, so nobody else could have seen the basic problem. :) anyway, it is solved, that is the most important.
    – Zollie
    Dec 11, 2020 at 13:33
  • 1
    @Thomas this is the first question that you have posted in the Stack Exchange Network, so I need to make sure that you know how to resolve this page. To inform the system that this question is resolved, please award your answer the green tick (when enough time has past to do so). Dec 12, 2020 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.