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.

Template Questions /

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

template ignored in module on remote server but not locally

Go to End

3 Posts   1012 Views


Community Member, 24 Posts

11 March 2014 at 2:53am

I am still a beginner with silverstripe, php et javascript but I am making progress. At the moment I am trying to write a module for an image browser of my own, mostly as a learning experience as there are a lot of existing modules.
The module seems to work fine locally (I mean on a localhost server). I have a customizable thumbails carrousel at the bottom of the page and a correctly displaying auto/manu slideshow at the top.

Now, as I would like to start dealing with ajax problem, I moved the module onto a remote server. I could create an ImageBrowserPage and uploads all the images. But what I don't understand is why my seems to be ignored on the remote server (the page use the standard page layout) and taken into account when working on the local server.

The module is called imagebrowser. The ImageBrowserPage.php is placed under imagebrowser/code and the is placed under imagebrowser/templates/Layout. The mechanics imagebrowser.js (that is still embryonary — no ajax) is placed under imagebrowser/js.

Thank you for help.

Relevant files:



class ImageBrowserPage extends Page {
	private static $many_many = array ('BrowserImages' => 'Image');

	function getCMSFields () {

	$fields = parent:: getCMSFields();
        $fields->addFieldToTab (
		$uploadField = new UploadField (
			$name = 'BrowserImages',
			$title = 'Upload one or more images'

	return $fields;

class ImageBrowserPage_Controller extends Page_Controller{

function getImages(){
	return $this->BrowserImages;


	<% require javascript("/imagebrowser/thirdparty/jquery-1.11.0.js") %>
<% require javascript("/imagebrowser/js/imagebrowser.js") %>

<script src="/imagebrowser/thirdparty/jquery-1.11.0.js"></script>
<script src="/imagebrowser/js/imagebrowser.js"></script>

<% require css("imagebrowser/css/carrousel.css") %>

<div class="content-container unit size3of4 lastUnit">



			<div id="param" data-options = '{
			"imageBaseName" : "image",
				"imageExt"  :".JPG"}'>

			<div id="conteneur">
				<div id="carrousel">

					<% loop $BrowserImages %>


						<div class="slide">
 							<div class="visu">
								<img src="$Filename" />
							<div class="title">

					<% end_loop %>





Forum Moderator, 5522 Posts

11 March 2014 at 7:26pm

Make sure you've run ?flush=1 on your production server and your page is the ImageBrowserPage page in the CMS.


Community Member, 24 Posts

11 March 2014 at 9:17pm

Hi Willr,

Thank you for answer. I eventually managed to have it working but I must confess I am not really at ease with flushing.
I am still wondering what are the differences between those:


Probably I missed something important in the documentation

Now I am trying to change some javascript but the changes are effectless also. Thus I conclude I am still having trouble with some caching.