Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
Report any technical problems you discover and discuss solutions.
  • Page:
  • 1
  • 2

TOPIC:

Accordion Navigator inserting extra paragraphs 7 years 7 months ago #4436

  • curryd
  • curryd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 15
  • Thank you received: 0
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:
<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:
<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?

Please Inloggen or Create an account to join the conversation.

Accordion Navigator inserting extra paragraphs 7 years 7 months ago #4437

  • tom
  • tom's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1286
  • Thank you received: 324
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.

Please Inloggen or Create an account to join the conversation.

Accordion Navigator inserting extra paragraphs 7 years 7 months ago #4438

  • curryd
  • curryd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 15
  • Thank you received: 0
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.

Please Inloggen or Create an account to join the conversation.

Accordion Navigator inserting extra paragraphs 7 years 7 months ago #4439

  • tom
  • tom's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1286
  • Thank you received: 324
Github repo can be found here:

github.com/thexerteproject/xerteonlinetoolkits
The following user(s) said Thank You: curryd

Please Inloggen or Create an account to join the conversation.

Accordion Navigator inserting extra paragraphs 7 years 7 months ago #4440

  • curryd
  • curryd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 15
  • Thank you received: 0
Oh, I did have the right repo. The README.md file talks about v3.2, so I thought it was out of date. :-)

Please Inloggen or Create an account to join the conversation.

Accordion Navigator inserting extra paragraphs 7 years 7 months ago #4441

  • curryd
  • curryd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 15
  • Thank you received: 0
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
var infoString = '<p>' + x_addLineBreaks(this.getAttribute("text")) + '</p>',
to
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.

Please Inloggen or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ronmjultenJohnSmith
Time to create page: 0.081 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search