Well, using the path of a particular page works, but then all I get is
the content for that one particular page, on every page...
<cms:loadPage path="udhome/contact_us"/>
I could borrow some code from the mailHandler, but then I get a node
cooridinate or something...
<%@ page import="info.magnolia.cms.util.Resource" %>
<%= Resource.getActivePage(request) %>
[EMAIL PROTECTED]
I could get the context path, but that doesn't return the full path I
need...
<%= request.getContextPath() %>
Not that it would return the full path, but experts-exchange says
"((HttpServletRequest) pageContext.getRequest()).getContextPath()" can
be used in a tag lib, but that don't work...
<cms:out nodeDataName="${((HttpServletRequest)
pageContext.getRequest()).getContextPath()}"/>
I obviously need a method to dynamically generate the full virtual URI
of a given CMS page, but don't know what the method is. So close I can
taste it :(=
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 13, 2005 1:42 PM
To: [email protected]
Subject: Re: [magnolia-user] sharing contents
Finally had a chance to try this. I'm reusing content in the left
column.
The paragraphs defined on the home page are reused, unless you define
unique paragraphs on a particular page, in which case the 'defaults'
don't appear.
Works good except the content in my main column goes away. I suspect
this is because I'm not restoring the original page with 'loadPage'.
I'm doing the usual...
editBar
includeTemplate
newBar
...with...
<cms:ifEmpty contentNodeCollectionName="leftParagraphs">
<cms:loadPage path="udhome"/>
<cms:contentNodeIterator
contentNodeCollectionName="leftParagraphs">
<cms:includeTemplate />
</cms:contentNodeIterator>
<cms:loadPage path="??????????"/>
</cms:ifEmpty>
...afterwards, which is how Mr. Rozsa implemented this content reuse
concept, except with out the 2nd 'loadPage'.
Maybe his HTML code would drop off afterwards too, but since there's no
content after the right column, he doesn't have a problem.
What should the value of 'path' be to 'restore the original page'?
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
Sent: Friday, August 19, 2005 4:26 AM
To: [email protected]
Subject: Re: [magnolia-user] sharing contents
With JSP you should be capable of traversing the whole repository tree
and collect data as you wish.
Also, have a look at the loadPage tag of the cms taglib. With it you can
load an other page and then access its content using the normal tags
(e.g. ContentNodeIterator).
So, frankly, what you do is:
1. Create a page in your site tree called "right_column_content" and
make sure it does not show up in the navigation.
2. In your page templates, at the right column 3. Just before the right
column jsp code loadPage your "right_column_content" page 4. iterate
through its content 5. restore the original page (again using loadPage)
I've did this for news content that should show up at several places in
the site tree. I personally think it's rather an ugly hack but I was too
lazy to come up with my own custom tag.
Good luck!
-Will
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------