Report any technical problems you discover and discuss solutions.

Accordion Navigator inserting extra paragraphs

  • curryd
  • Onderwerp Auteur
  • Offline
  • Nieuw lid
  • Nieuw lid
Meer
9 jaren 3 maanden geleden #4436 door curryd
I'm using Xerte 3.4 (git v3.4.1).

If I create a new Accordion Navigator page and add a new nested page, the generated HTML for the page looks like this:
Code:
<div id="infoHolder" ...> <h3 class="paneHeader ui-accordion-header ..." ...> <span class="ui-accordion-header.." ...></span> <a href="#">My pane title</a> </h3> <div class="paneContents ui-accordion-content ..."> <p>Content for the pane</p> </div> </div>

However, as soon as I replace the "Content for the pane" with my own text, the generated HTML looks like this:
Code:
<div id="infoHolder" ...> <h3 class="paneHeader ui-accordion-header ..." ...> <span class="ui-accordion-header.." ...></span> <a href="#">My pane title</a> </h3> <div class="paneContents ui-accordion-content ..."> <p></p> <-- NOT SUPPOSED TO BE HERE <p>My content</p> <p></p> <-- NOT SUPPOSED TO BE HERE </div> </div>

Notice the extra, blank paragraphs above and below my text.

This happens regardless of whether I edit the content directly, or through the "source" raw html interface. Those extra blank paragraphs are NOT appearing in the editor window. Looking at the template.xml, it looks like the text of the various panels is passed as an attribute to a nestedPage XML element, rather than as CDATA. And then models_html5/accNav.html is just taking the text as an attribute and sticking it into the DOM with <p> tags around it.

Am I misunderstanding how this is supposed to work?

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
9 jaren 3 maanden geleden #4437 door tom
Beantwoord door tom in topic Accordion Navigator inserting extra paragraphs
Good catch. This is probably a historical issue.

1. The first editor, was flash based, and so the content was not realy html (The flash based editor didn't have a WYSIWYG editor), so that's the reason why the contents of the xml is surrounded by a <p> tag.

2. The new editor uses CKEditor, and that editor encapsulates it's content always in a <p> tag. Whatever you do.

So now, we have content both with and without a <p> tag. The new content should just be added to the pane, without surrounding it again with <p>.

I dont't think we realised this when creating the new editor.

We'll fix this issue (in the model file) and we need to check other occurrences as well.

If you catch others, please let us know.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • curryd
  • Onderwerp Auteur
  • Offline
  • Nieuw lid
  • Nieuw lid
Meer
9 jaren 3 maanden geleden #4438 door curryd
Beantwoord door curryd in topic Accordion Navigator inserting extra paragraphs
For what it's worth, the Tabbed Navigator does the right thing with the same content (two or three paragraphs, with other tags, like <strong>, in them). Perhaps, then, this is just an accordion navigator issue.

Unfortunately for me, the tabbed navigator just won't meet my needs in this case (I have phrases for the click-on-me names of the panels, and the tab layout doesn't have room for them). :-(

Is the Git repository for the current Xerte code accessible, so I could maybe pick up this fix once it's made? All of the repos I see on GitHub seem to be for old versions.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
9 jaren 3 maanden geleden #4439 door tom
Beantwoord door tom in topic Accordion Navigator inserting extra paragraphs
Github repo can be found here:

github.com/thexerteproject/xerteonlinetoolkits
De volgende gebruiker (s) zei dank u: curryd

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • curryd
  • Onderwerp Auteur
  • Offline
  • Nieuw lid
  • Nieuw lid
Meer
9 jaren 3 maanden geleden #4440 door curryd
Beantwoord door curryd in topic Accordion Navigator inserting extra paragraphs
Oh, I did have the right repo. The README.md file talks about v3.2, so I thought it was out of date. :-)

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • curryd
  • Onderwerp Auteur
  • Offline
  • Nieuw lid
  • Nieuw lid
Meer
9 jaren 3 maanden geleden #4441 door curryd
Beantwoord door curryd in topic Accordion Navigator inserting extra paragraphs
Following your "hint" in your first reply, I took a look at the model file. I can confirm that changing line 97 of modules/xerte/parent_templates/Nottingham/models_html5/accNav.html from
Code:
var infoString = '<p>' + x_addLineBreaks(this.getAttribute("text")) + '</p>',
to
Code:
var infoString = x_addLineBreaks(this.getAttribute("text")),
(stop putting the '<p>' and '</p>' tags around the string) appears to fix the immediate problem I complained about in the first post. I'm not sure I have a deep enough understanding of the code to say whether this is a complete (or even correct) fix, so I will humbly refrain from submitting it as a pull request.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: ronmjultenJohnSmith
Tijd voor maken pagina: 0.154 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo