Jump to:

23480 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Images Issues

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: 736 Views
  • jigster
    Avatar
    Community Member
    15 Posts

    Images Issues Link to this post

    Hi I am using version 2.3.0 and I can use the content field in my CMS on my homepage to insert images which works fine. However on my other page types Only text will show in the published page. Images show up in the CMS content field but do not display on the web....All I get is white space...Can anyone give me advice on the issue?

  • jigster
    Avatar
    Community Member
    15 Posts

    Re: Images Issues Link to this post

    for reference my php for the page types are as follows:

    <?php
    /**
    * Defines the HomePage page type
    */

    class HomePage extends Page {
    static $db = array(

    'ContentTwo'=> 'HTMLText'
    );

       static $has_one = array(
    );

    function getCMSFields() {
    $fields = parent::getCMSFields();

    $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('ContentTwo', 'Content Two'));

    return $fields;
    }

    }

    class HomePage_Controller extends Page_Controller {
       
    }

       
    ?>

    <?php
    /**
    * Defines the WhatWeDo page type
    */
    class WhatWeDo extends Page {
    static $db = array(

    'Content2'=>'HTMLText',
    'Content3'=>'HTMLText',
    'Content4'=>'HTMLText',
    'Content5'=>'HTMLText'
    );

    static $has_one = array(
    );

    function getCMSFields() {
    $fields = parent::getCMSFields();

    $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Content2', 'Content 2'));
    $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Content3', 'Content 3'));
    $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Content4', 'Content 4'));
    $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Content5', 'Content 5'));

    return $fields;
    }

    }

    class WhatWeDo_Controller extends Page_Controller {
    }

    ?>

  • jigster
    Avatar
    Community Member
    15 Posts

    Re: Images Issues Link to this post

    Problem solved......I missed the <% base_tag %> in the head of my .ss file.

    736 Views
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.