You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Bob Harner <bo...@gmail.com> on 2006/01/20 21:31:14 UTC

Site tree linking to non-documents

Hello, all!

Currently in Lenya 1.2.4, when you create a new page, it appears as a
node in the site tree and thus as a link in the navigation menu.  But
what my editorsI do if they want some of the links in the navigation
menu to link to things other than standard Lenya documents?

There are three things in particular that I would like to link to from
the navigation menu:

1) External web sites (full URL)
2) Other Lenya documents located elsewhere in the site tree (relative URL)
3) Assets, such as a PDF file that is an asset to some page (relative URL)

As far as I know the nodes in a site tree can only be Lenya documents
-- that is, instances of a defined resource type (doctype).

Do I need to define a new resource type (maybe called "hyperlink")?  I
know Lenya 1.4 comes with a "links" resource type already defined, but
it seems to be for creating a page of links rather than a single link.
 I want to be able to click on a menu item and go right to that
object.

Any ideas?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Site tree linking to non-documents

Posted by so...@apache.org.
On 1/20/06, Bob Harner <bo...@gmail.com> wrote:
> Currently in Lenya 1.2.4, when you create a new page, it appears as a
> node in the site tree and thus as a link in the navigation menu.  But
> what my editorsI do if they want some of the links in the navigation
> menu to link to things other than standard Lenya documents?
>
> There are three things in particular that I would like to link to from
> the navigation menu:
> 1) External web sites (full URL)
> 2) Other Lenya documents located elsewhere in the site tree (relative URL)
> 3) Assets, such as a PDF file that is an asset to some page (relative URL)
>
> As far as I know the nodes in a site tree can only be Lenya documents
> -- that is, instances of a defined resource type (doctype).
>
> Do I need to define a new resource type (maybe called "hyperlink")?  I
> know Lenya 1.4 comes with a "links" resource type already defined, but
> it seems to be for creating a page of links rather than a single link.
>  I want to be able to click on a menu item and go right to that
> object.

We have a similar architecture on a non-Lenya system.  (Using Lenya
terms) there are several publications with the top-level publication
having menu links to documents and other publications, and the others
having documents and a "Return to Home Page" menu link.  Rather than
building a new DocType, we create standard documents with the content:
  <SCRIPT LANGUAGE="JAVASCRIPT">
  window.location="http://solprovider.com/lenya";
  </SCRIPT>
The page starts to load, then the browser loads the "external" URL. 
This does not work well with Lenya.  The Kupu editor gives many
errors.  Accessing the page in the GUI will load the external page, so
you never edit it again.

Another method is create a new DocType.  The "Redirect Location" Field
should set the JS, the META REFRESH, and a link in the content for
"Click here to go to the external page" for when browsers do not
handle it automatically.  It could also set a flag in the navigation
elements so the menus can add a symbol for "This menu item goes to an
external website."  I did not test that method.

The best method would be the menu link directly refers to the external
website.  In Lenya 1.2, navigation uses sitetree.xml without looking
at the document files.  sitetree2nav.xsl has a bypass so if
sitetree.xml has an entry:
   <node id="externaltest" visibleinnav="true" href="http://solprovider.com">
   <label xml:lang="en">External Test</label>
   </node>
Then the menu entry will link to the external website.  If you add the
HREF to the Live version (content/live/sitetree.xml), it will survive
the document being published again.

Using the GUI would be very difficult.  It requires a method to edit
the HREF property in sitetree.xml, similar to the "rename-label"
Usecase.  There is no Ant task for editing the HREF.  Worse, if the
HREF attribute exists in the Authoring SiteTree
(content/authoring/sitetree.xml), the GUI will not be able to access
the document.  If it is named something like "livehref", you need to
reprogram the publishing system to change the attribute name during
publishing.  It must be done during publishing because non-standard
attributes will not be copied by the default publisher.

***
The best solution without completely rewriting Lenya is to manually
add the HREF attribute to the "node" entry in
content/live/sitetree.xml.  Then clear the cache if you are using one.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Site tree linking to non-documents

Posted by Michael Wechner <mi...@wyona.com>.
Bob Harner wrote:

>Hello, all!
>
>Currently in Lenya 1.2.4, when you create a new page, it appears as a
>node in the site tree and thus as a link in the navigation menu.  But
>what my editorsI do if they want some of the links in the navigation
>menu to link to things other than standard Lenya documents?
>
>There are three things in particular that I would like to link to from
>the navigation menu:
>
>1) External web sites (full URL)
>2) Other Lenya documents located elsewhere in the site tree (relative URL)
>3) Assets, such as a PDF file that is an asset to some page (relative URL)
>
>As far as I know the nodes in a site tree can only be Lenya documents
>  
>

no. I think you can use the href attribute, but I am not sure
if there is a user interface to edit this out-of-the-box.

Whereas I am pretty sure the University of Zurich publication does this

>-- that is, instances of a defined resource type (doctype).
>
>Do I need to define a new resource type (maybe called "hyperlink")?  I
>know Lenya 1.4 comes with a "links" resource type already defined, but
>it seems to be for creating a page of links rather than a single link.
> I want to be able to click on a menu item and go right to that
>object.
>
>Any ideas?
>  
>
see above resp. take a look at

|svn co --username anonymous 
http://svn.wyona.org/repos/public/lenya/unicms/trunk unicms

but I actually thought the default publication does also support this, 
but maybe it's
just hidden somewhere.

HTH

Michi
|

>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>For additional commands, e-mail: user-help@lenya.apache.org
>
>
>  
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org