Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

html tag showed (inside layout)

Go to End

2 Posts   679 Views


Community Member, 1 Post

16 July 2011 at 3:05am

Edited: 16/07/2011 3:07am

i created a BusinessPartner DataObject
here is the structure

.. _config.php
.. code/
....BusinessPartner (extends DataObject)
....BusinessPartnerAdmin (extends ModelAdmin)

in my page i added

// class Page extends SiteTree
public static $db = array('BusinessPartner' => 'Boolean');

function getCMSFields() {
    $fields->addFieldToTab("Root.Content.BusinessPartner", new CheckboxField('BusinessPartner', 'Include a Business Partner on this page?'));

in Page_Controller
function BusinessPartner() {
  if($this->BusinessPartner) {
    $d['BusinessPartner'] = DataObject::get('BusinessPartner');
      return $this->customise($d)->renderWith('BusinessPartner');
  return FALSE;


in templates/Layout/
i add $BusinessPartner (after $Content)

i also create a Layout for BusinessPartner (templates/Layout/

when the page created, the data showed. but the HTML tag not showed correctly. instead its showed all html tags

<table border="1">
<td>Agent Name</td>
<td>Tel / Fax</td>
<% control BusinessPartner %>
	<td>$Telephone / $Fax</td>
	<td><a href="mailto:$Email">$Email</a></td>
<% end_control %>

the tag <table>, <tr>, <td> showed, and the data from control BusinessPartner looped from database.

what i missed here ???


Community Member, 176 Posts

1 August 2011 at 6:50pm

There is no closing </table> tag, that could be it.