Jump to:

1347 Posts in 439 Topics by 514 members

Themes

SilverStripe Forums » Themes » Selecting HomePage.ss in theme

Discuss SilverStripe Themes.

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

Page: 1 2
Go to End
Author Topic: 3405 Views
  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: Selecting HomePage.ss in theme Link to this post

    Hi!

    Well, are you sure welcome.png is there? The URL is correct. I guess you flushed the cache…

    I suggest you to check the page source and verify that the div banner is there, so to confirm that the problem is the image not being loaded.

  • onhamotminh
    Avatar
    Community Member
    4 Posts

    Re: Selecting HomePage.ss in theme Link to this post

    Hi Juan!

    step1:
    Create HomePage.php (path /mysite/code/):
    <?php
    /**
    * Defines the HomePage page type
    */

    class HomePage extends Page {
    static $db = array(
    );
    static $has_one = array(
    );

    }

    class HomePage_Controller extends Page_Controller {
       
    }
    ?>

    step2 : run http://localhost:82/silverstripe/dev/build?flush=1

    step 3 : Home Page assigned it to page type HomePage created (step2)

    step 4 :

    i checked image welcome.png correct with path as well as div banner (attach file)

    Create HomePage.ss (path /themes/tutorial/templates/Layout/ and i tried with path /themes/tutorial/templates/ ):
    <div id="Banner">
    <img src="themes/tutorial/images/welcome.png" alt="Homepage image" />
    </div>
    <div id="Content" class="typography">
    $Content
    </div>

    step 5: I flushed the cache by http://localhost:82/silverstripe/?flush=1

    My home page is not change with new layout. Please, Can you guide me which mistake ? Thanks Juan

    Attached Files
  • onhamotminh
    Avatar
    Community Member
    4 Posts

    Re: Selecting HomePage.ss in theme Link to this post

    Thanks Juan

    I changed home page with new template. Because first install, I was not selected template(empty) to begin tutorial.

    Thanks again!

  • AL
    Avatar
    Community Member
    7 Posts

    Re: Selecting HomePage.ss in theme Link to this post

    I'm having problems with this /dev/buid/?flush=1.
    My development address for my site is http://localhost/SilverStripe/.
    I've created the HomePage.php in mysite/code folder, I've pasted the code from tutorial.
    When I try to run "http://localhost/SilverStripe/dev/build/?flush=1" I get stuck with:

    "Not Found

    The requested URL /SilverStripe/dev/build/ was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

    What can I do next?

  • AL
    Avatar
    Community Member
    7 Posts

    Re: Selecting HomePage.ss in theme Link to this post

    Me again.
    I've solved it
    You have to look carefully at the site address.
    http://localhost/SilverStripe/index.php/dev/build/?flush=1

    I've tryed only with http://localhost/SilverStripe/dev/build/?flush=1 (without index.php in it)

    On local server I don't have apache rewrite_mode set on...

    Regards

  • suganya
    Avatar
    Community Member
    8 Posts

    Re: Selecting HomePage.ss in theme Link to this post

    Hi,

    I tried both http://localhost/mysite/index.php/dev/build/?flush=1 and http://localhost/mysite/dev/build/?flush=1 still getting error.

    Please help me.

    Thanks in advance.

  • thomas.paulson
    Avatar
    Community Member
    44 Posts

    Re: Selecting HomePage.ss in theme Link to this post

    Hi Suganya

    Try dev/build and ?flush=1 separately!

    I believe you should access folder SS project folder, not localhost/mysite

    3405 Views
Page: 1 2
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.