Topic: Link one page to another  (Read 313 times)

Pages: [1]   Go Down

#1: 2-Mar-2009, 05:20 AM

rnd
Posts: 34

Hi, I like to have one page to be completely replaced by another. The link variable [~id~] seems the right candidate, but where do I apply this in the original page? Thanks.

#2: 2-Mar-2009, 07:38 AM

Administrator

zi
MODx Special Forces /
Posts: 3,555

May Peace Be On You

WWW
You have to use it like this:

Code:
<a href="[~id~]">Link Text</a>

#3: 2-Mar-2009, 08:09 AM

rnd
Posts: 34

I actually meant a complete document, so link id1 to id2. When a request comes in for id1, it serves the contents of id2. Must be simple, but how.

#4: 2-Mar-2009, 08:13 AM


mrhaw
Posts: 1,839

modx == freedom

WWW
Create weblinks that point to your document!
My playground: http://4up2date.info | Twitter: mrhaw
---> Check out: ReadSpeaker webReader Plugin | Support/Comments Thread
--=[ MR. HAW ]=--

#5: 2-Mar-2009, 08:23 AM

Testers

dev_cw
Posts: 4,179

WWW
I am not sure your objectives:
1) include the content of page 2 in page 1
 -> Use a snippet like GetField to load the data from one page to another, or bind a TV to the content of another page

2) redirect the browser to page 2 from page 1
 -> Use a wblink or a redirect snippet (phiRedirect works well)

3) forward page 1 to page 2 (in forward the URL will still say page 1)
 -> Use the sendForward api call (like is used for error pages)
Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

Something is happening here, but you don't know what it is.
Do you, Mr. Jones?  -  [bob dylan]

#6: 2-Mar-2009, 09:04 AM

simonok
Posts: 173

I am an undercover genius

WWW
or just link to the actual document you want to show, no need to make work for yourself.
I made my first site with modx
------------------------
Shopping blog
Sky+ HD

#7: 12-Mar-2009, 04:07 PM

rnd
Posts: 34

I am not sure your objectives:

2) redirect the browser to page 2 from page 1
 -> Use a wblink or a redirect snippet (phiRedirect works well)

3) forward page 1 to page 2 (in forward the URL will still say page 1)
 -> Use the sendForward api call (like is used for error pages)

Sorry for late response, was away, but the API sendForward call is doing what I want: a request for page 1 delivers page 2. Page 1 is an existing home page, where is the right place to add this call? Wrap it in a snippet and add it to the header? Or is there a more direct/faster way to do so?

UPDATE: API call wrapped in snippet works fine, pass in a document id and wherever the parser encounters the call, jumps to the other document.

Thanks
« Last Edit: 12-Mar-2009, 08:47 PM by rnd »
Pages: [1]   Go Up
0 Members and 1 Guest are viewing this topic.