21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1402 Views |
-
Loading page content on another page

18 March 2010 at 2:26am Last edited: 18 March 2010 2:27am
I want to load page content from another page into another page, by using the site tree dropdown. I have everything in place, but I am not sure how to add the code to grab the page...
This works
<div class="typography"><h1><% control Title %>$XML<% end_control %></h1>
<% control Page(disclaimer) %>$Content<% end_control %></div>This does not
<div class="typography"><h1><% control Title %>$XML<% end_control %></h1>
<% control Page(MyDataFieldName) %>$Content<% end_control %></div>My page code... All seems to do well.
$fields->addFieldToTab('Root.Content.Main', new TreeDropdownField('DuplicateContentPage', 'Select Page:', 'SiteTree', 'URLSegment', 'MenuTitle'));
In the databse, the value is 0 (zero), and I need it to be the page name - like home, or special-footer
Thank you
Steve Nyhof -
Re: Loading page content on another page

18 March 2010 at 12:08pm
You can't pass variables into statements (like foo($Bar)) which is what you're doing. Instead what you should be doing is having a relationship between the pages then you can go <% control ThatOtherPageThisRelatesTo %>$Content<% end_control %>
-
Re: Loading page content on another page

18 March 2010 at 12:24pm
Thank you willr,
I had a feeling it would need to be done that way. I finally hired a full time programmer but have him busy with other things right now, but your statement will give him some direction.
Thank you,
Steve Nyhof -
Re: Loading page content on another page

7 April 2011 at 4:02pm
Okay, I've tried for a week. I am sure I am missing something small. On my homepage I have a little section where special information can be pulled into display. On pages other than the homepage I put in a couple of sidebar sections that can be edited in the CMS then just pulled into the page. But trying to build this similar idea for the homepage I am missing something. I created every thing the same as I did for my sidebar sections, did a dev build, in the CMS I see I can put the page type of homespecial. I built a page and put content in it. But the content from the CMS will not display. I know the section is there because I can see the <div>...</di> for the homepage.ss file. In homepage.ss I have
<% control HomeSpecial %>
$Content
<% end_control %>So, what am I missing.
Thanks
| 1402 Views | ||
|
Page:
1
|
Go to Top |



