Welcome, Guest. Please login or register.
Did you miss your activation email?
Feb. 09, 2010, 03:35:51 PM
52593 Posts in 11677 Topics by 7491 Members
Latest Member: peerjee
News: Share your PRADO experience with other PRADOers by commenting on the QuickStart Tutorial.
 
The PRADO Community » Prado v3.x » General Discussion » Nested Templates and TConfigurationExceptions « previous next »
Pages: [1] Print
Author Topic: Nested Templates and TConfigurationExceptions  (Read 1597 times)
sparks
Newbie
*

Karma: 0
Offline Offline

Posts: 2


View Profile
« on: Oct. 03, 2007, 03:21:17 PM »

Folks,
I have a small problem with nested templates in Prado at the moment. What I have is:

MainLayout.tpl:
Code:
<html>
<com:THead />
<body>
<com:TForm>
<com:TContentPlaceHolder ID="ScreenTitle"/>
<com:TContentPlaceHolder ID="Titlebar" />
<com:TContentPlaceHolder ID="Menu" />
<com:TContentPlaceHolder ID="Content" />
</com:TForm>
</body>
</html>

StudentView.tpl:
Code:
<%@ MasterClass="Application.layouts.MainLayout" %>
<com:TContent ID="Content">
<com:TContentPlaceHolder ID="placetitlecontent"/>
<com:TContentPlaceHolder ID="subplacescontent"/>
<com:TContentPlaceHolder ID="episodescontent"/>
<com:TContentPlaceHolder ID="resourcescontent"/>
</com:TContent>

Home.page:
Code:
<com:TContent ID="Titlebar">
<com:TBulletedList ID="Breadcrumb"/>
</com:TContent>

<com:TContent ID="Menu">
<com:TBulletedList ID="menulist" />
</com:TContent>

<com:TContent ID="placetitlecontent">
<com:TLabel ID="contenttext" />
<com:TBulletedList ID="exits" DisplayMode="LinkButton" />
</com:TContent>

config.xml:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <pages MasterClass="Application.layouts.StudentView" />
</configuration>

According to all the tutorials, this should work, but what I get is a TConfigurationException:
Description
TContent 'Titlebar' does not have a matching TContentPlaceHolder.
Source File
/www/prado/3.1.1.r2290/framework/Web/UI/TTemplateControl.php (212)


Any ideas what could be causing this?
Logged
Qiang
PRADO Team Leader
Administrator
Diamond Member
*****

Karma: 100
Offline Offline

Posts: 3241



View Profile
« Reply #1 on: Oct. 03, 2007, 03:40:46 PM »

This usage is not supported by design. The matching of TContent and TContentPlaceHolder must be between direct master class and content class.

Logged
sparks
Newbie
*

Karma: 0
Offline Offline

Posts: 2


View Profile
« Reply #2 on: Oct. 03, 2007, 04:09:46 PM »

Oh bother.
So it's not so much nested templates then as it is loosely linked templates.
Oh well.

Thanks as well to aztech, by the way, who answered a panicy PM about this topic as well and who suggested this to solve the problem (it does, btw):

StudentView.tpl:
Code:
<%@ MasterClass="Application.layouts.MainLayout" %>
<com:TContent ID="Content">
<com:TContentPlaceHolder ID="placetitlecontent"/>
<com:TContentPlaceHolder ID="subplacescontent"/>
<com:TContentPlaceHolder ID="episodescontent"/>
<com:TContentPlaceHolder ID="resourcescontent"/>
</com:TContent>
<com:TContent ID="ScreenTitle">
  <com:TContentPlaceHolder ID="ScreenTitleDeep"/>
</com:TContent>
<com:TContent ID="TitleBar">
  <com:TContentPlaceHolder ID="TitleBarDeep"/>
</com:TContent>
<com:TContent ID="Menu">
  <com:TContentPlaceHolder ID="MenuDeep"/>
</com:TContent>
<com:TContent ID="Content">
  <com:TContentPlaceHolder ID="ContentDeep"/>
</com:TContent>
Logged
Pages: [1] Print 
« previous next »
Jump to: