Passing the content of a short-text element to another page?

General discussions about WebYep
Post Reply
Marz
Posts: 9
Joined: Thu Feb 05, 2009 2:15 pm

Passing the content of a short-text element to another page?

Post by Marz » Sun Jan 23, 2011 4:14 pm

Hi there,

I have 2 pages;

Page 1 has a 'loop-element' which contains both a 'short-text element' and a 'read more' hyperlink to a second page which shows different content depending on which hyperlink was clicked.

I'm looking for a solution to have the text entered in the looped short-text element on page 1, automatically be duplicated and appear on page 2 (I tried adding a short-text element on page 2 with the same fieldname and setting the global variable on page 1 and 2 to 'appear on all pages' to true this doesn't work. All instances of this short-text item on page 1 an 2 then get the same content).

Is it possible to have the text entered in the short-text element within the loop on page 1, passed to the page 2 e.g. as the value of a variable? (I was thinking in the lines of passing the value with the url, but I don't know the unique ID of the content of the short text element or if this is possible.)

Another possible solution I could think of was indeed use the global setting 'appear on all pages' on the short-text element, place a copy of this element on both page 1 and page 2, but use a dynamic and unique ID PHPcode from the current loop element as the fieldname in both instances. In theory this would make the fieldname the same on both pages and different per loop item. But I'm not sure which, - if any, of the ID's within a loop item do get transferred to page 2 or would be suitable.

Regards,
Marz

Max
Rank 4
Rank 4
Posts: 176
Joined: Wed Nov 08, 2006 10:39 pm
Location: UK
Contact:

Re: Passing the content of a short-text element to another page?

Post by Max » Wed Feb 16, 2011 3:10 pm

Hi Marz
if you are trying to duplicate a looped item on another page then there are two ways I can think of doing it

Option 1:
Create an admin page which contains the loop and nothing else so no extra graphics etc
then on the two pages which you want the duplicate content to appear ad an iframe and reference the looped page as its source
the result is you have a proper looped item duplicated on two different pages

Option 2:
Create an admin page which contains the loop and nothing else so no extra graphics etc
then using a javascript frame work like MoreCSS pull in the the page into your two pages
an example similar to what you are describing is this:
http://morecss.yellowgreen.de/include-content
http://morecss.yellowgreen.de/include-content-demo
obviously this isn't webyep loop content... but it should work

I prefer the javascript method because I find the iframe option tends to be a bit restrictive in terms of "flexible height content" (normally I find the iframe just adds scroll bars and doesn't expand in height to accommodate the webyep looped content)

Post Reply