[MAGNOLIA-562] Paragraphs In Paragraphs Created: 05/Oct/05  Updated: 23/Jan/13  Resolved: 17/May/06

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: 2.1 Final
Fix Version/s: None

Type: Bug Priority: Major
Reporter: emmanuel.davis@akqa.com Assignee: Boris Kraft
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

redhat


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

The paragraph in paragrah example does not work. The is a error when implementing the example code on the wiki "ParagraphHowToPutParagraphsInParagraphs"

Please let me know how i can place a paragraph in a paragraph



 Comments   
Comment by Jabe Bloom [ 07/Oct/05 ]

See: http://www.magnolia.info/wiki/Wiki.jsp?page=NestedParagraphs

I had to tweak it but it works.

Comment by Paul Pogonoski [ 17/Feb/06 ]

I used the tweak created by Jabe Bloom.
This too, had to be tweeked but I got it to work.

The problem is that the paragraphs can't be moved. I can click on the move button and I'm told when I can click on another bar that it will move it to preceed that parapgraph (all as per normal).
However, when I do this nothing happens - nothing gets moved, no error messages, nothing - the action is just ignored.

Here is the source code for the JSP:
<%@ taglib uri="cms-taglib" prefix="cms" %> <%@ taglib uri="cms-util-taglib" prefix="cmsu" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%@ page import="java.util.Iterator,
info.magnolia.cms.util.Resource,
info.magnolia.cms.core.Content,
info.magnolia.cms.gui.inline.BarEdit,
info.magnolia.cms.gui.inline.BarNew,
info.magnolia.cms.beans.config.Server,
info.magnolia.cms.beans.config.Paragraph,
javax.jcr.PathNotFoundException"
%>

<%
// prepare page title
String title = Resource.getActivePage(request).getNodeData("title").getString();
if(title == null)

{ title = Resource.getActivePage(request).getNodeData("contentTitle").getString(); }

title = title.toUpperCase();

// make it accessable for jstl
pageContext.setAttribute("title", title); %>

<!-- content title -->
<!-h1>${title}</h1->

<%
String collectionOuter="Outer";

try {
Iterator it0 = null;
try

{ it0=Resource.getActivePage(request).getContent(collectionOuter).getChildren().iterator(); }

catch (PathNotFoundException pnf) {};

if (it0 != null){
while (it0.hasNext()) {
Content tab =(Content) it0.next();

if (Server.isAdmin())

{ BarEdit barOuter=new BarEdit(request); barOuter.setSmall(false); barOuter.setNodeCollectionName(collectionOuter); barOuter.setNodeName(tab.getName()); barOuter.setParagraph(tab.getNodeData("paragraph").getString()); barOuter.setPath(Resource.getActivePage(request).getHandle()); barOuter.setDefaultButtons(); barOuter.placeDefaultButtons(); barOuter.getButtonEdit().setLabel("Edit group"); barOuter.getButtonMove().setLabel("Move group"); barOuter.getButtonDelete().setLabel("Delete group"); barOuter.drawHtml(out); //out.println("<b>"+collectionOuter+"::"+tab.getName()+"</b><br><br>"); }

Resource.setLocalContentNode(request, tab);
String paragraphName = tab.getNodeData("paragraph").getString();
Paragraph paragraph = Paragraph.getInfo(paragraphName);
String jspPage = paragraph.getTemplatePath();
if (jspPage != null)

{ pageContext.include(jspPage); }

//sub paragraphs
String collectionInner="Inner"+tab.getName();
try {
Iterator it1 = null;
try

{ it1=tab.getContent(collectionInner).getChildren().iterator(); }

catch (PathNotFoundException pnf) {};

if (it1 != null){
while (it1.hasNext()) {
Content par=(Content) it1.next();

if (Server.isAdmin())

{ BarEdit barInner=new BarEdit(request); barInner.setNodeCollectionName(collectionInner); barInner.setNodeName(par.getName()); barInner.setParagraph(par.getNodeData("paragraph").getString()); barInner.setPath(tab.getHandle()); barInner.setDefaultButtons(); barInner.placeDefaultButtons(); barInner.drawHtml(out); //out.println(collectionInner+"::"+par.getName()+"<br><br>"); }

Resource.setLocalContentNode(request, par);
paragraphName = par.getNodeData("paragraph").getString();
paragraph = Paragraph.getInfo(paragraphName);
jspPage = paragraph.getTemplatePath();
if (jspPage != null)

{ pageContext.include(jspPage); }

}
}
}
catch (Exception e)

{throw new Exception(e.toString());}
if (Server.isAdmin()) { BarNew newbarInner=new BarNew(request); newbarInner.setNodeCollectionName(collectionInner); newbarInner.setNodeName("mgnlNew"); newbarInner.setParagraph("samplesTextImage"); newbarInner.setPath(tab.getHandle()); newbarInner.setDefaultButtons(); newbarInner.placeDefaultButtons(); newbarInner.drawHtml(out); }

//out.println("<br><br>");
}
}

}
catch (Exception e) {throw new Exception(e.toString());}

if (Server.isAdmin()) {
BarNew newbarOuter=new BarNew(request); newbarOuter.setSmall(false); newbarOuter.setNodeCollectionName(collectionOuter);
newbarOuter.setNodeName("mgnlNew");
newbarOuter.setParagraph("columnGroup");
newbarOuter.setPath(Resource.getActivePage(request).getHandle());
newbarOuter.setDefaultButtons();
newbarOuter.getButtonNew().setLabel("New Group"); newbarOuter.placeDefaultButtons();
newbarOuter.drawHtml(out);
}
%>

<!-- spacer -->
<div style="clear:both;">
<c:if test="${spacer=='1'}">
<br/>
</c:if>
<c:if test="${spacer=='2'}">
<br/><br/>
</c:if>
</div>

I'm using 2.1.3 and IE 6.029 as the browser.

Comment by Philipp Bracher [ 17/May/06 ]

resolved since the comments explanes how to achieve it

Generated at Mon Feb 12 03:18:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.