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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Slideshow (jQuery Cycle) - Javascript Problem


Go to End


3 Posts   2660 Views

Avatar
ocean

Community Member, 37 Posts

12 December 2011 at 9:27am

Hi There,

Hopefully someone can help...

Installed the Slideshow module as instructed, all usual SS stuff plus the additional config line to activate it only on home page. The CMS all working beautifully, however, when I go to view the homepage (in dev mode) I get this;

 [Warning] file_get_contents() [function.file-get-contents]: Unable to access /home/***/public_html/www_test1/slideshow/javascript/init_slideshow.js
GET /?flush=1

Line 527 in /home/***/public_html/www_test1/sapphire/core/Requirements.php 

 Source

518 		else $this->customHeadTags[] = $html;
519 	}
520 	
521 	/**
522 	 * Load the given javascript template with the page.
523 	 * @param file The template file to load.
524 	 * @param vars The array of variables to load.  These variables are loaded via string search & replace.
525 	 */
526 	function javascriptTemplate($file, $vars, $uniquenessID = null) {
527 		$script = file_get_contents(Director::getAbsFile($file));
528 		$search = array();
529 		$replace = array();
530 
531 		if($vars) foreach($vars as $k => $v) {
532 			$search[] = '$' . $k;
533 			$replace[] = str_replace("\\'","'", Convert::raw2js($v)); 

Was not what I was expecting : ) Any ideas?

Best wishes
~ Sean

Avatar
Willr

Forum Moderator, 5523 Posts

13 December 2011 at 7:54pm

It means PHP tried to read that file and couldn't. Check your permissions on the file (webserver should have read access to that file - public_html/www_test1/slideshow/javascript/init_slideshow.js

Avatar
ocean

Community Member, 37 Posts

15 December 2011 at 9:21am

Thanks very much Willr, I'll keep a note of that one for future reference!

...I ended up moving to another JS solution from the latest 2.4 book.