Jump to:

23576 Posts in 19403 Topics by 2893 members

General Questions

SilverStripe Forums » General Questions » html tag showed (inside layout)

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

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

Page: 1
Go to End
Author Topic: 442 Views
  • hammudi
    Community Member
    1 Post

    html tag showed (inside layout) Link to this post

    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/Page.ss
    i add $BusinessPartner (after $Content)

    i also create a Layout for BusinessPartner (templates/Layout/BusinessPartner.ss)

    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 ???

  • MarijnKampf
    Community Member
    164 Posts

    Re: html tag showed (inside layout) Link to this post

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

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.