Page 1 of 2

Thumbnails - bludit3

Posted: Sun Sep 16, 2018 12:14 am
by bayerberg
I'm having a problem with thumbnails, I'm doing it the old fashion way:

Code: Select all

if ($page->coverImage()){
		echo'<a href="'.$page->permalink().'"><img alt="'.$page->title().'" src="'.HTML_PATH_UPLOADS_THUMBNAILS.$page->coverImage(false).'" height="400" width="400" /></a>';
}
Works on sticky pages, doesn't on regular content. regular content cover image doesn't respect (false) and plonks full asset address :|

Help :)

Re: Thumbnails - bludit3

Posted: Sun Sep 16, 2018 6:59 pm
by diego
Hi,
yes need to work as you mention, the page sticky is the same as a normal page only with a flag sticky.

Try this and check the results, also you have the method thumbCoverImage()

Code: Select all

<?php
	var_dump($page->coverImage(true));
	var_dump($page->coverImage(false));
	var_dump($page->thumbCoverImage());
?>

Re: Thumbnails - bludit3

Posted: Mon Sep 17, 2018 12:41 am
by bayerberg

Code: Select all

 	var_dump($page->coverImage(true));
 	var_dump($page->coverImage(false));
string(62) "http:// localhost: 8888/bluditrc3/bl-content/uploads/post-00.jpg"
string(62) "http:// localhost: 8888/bluditrc3/bl-content/uploads/post-00.jpg"

and

Code: Select all

 
 var_dump($page->thumbCoverImage());
string(124) "http:// localhost: 8888/bluditrc3/bl-content/uploads/thumbnails/http:// localhost: 8888/bluditrc3/bl-content/uploads/post-00.jpg"


no go, trying to figure out whats what.
MAMP / phph 7.2.1 / Apache

Re: Thumbnails - bludit3

Posted: Mon Sep 17, 2018 9:49 am
by diego
looks like the name of the file is

Code: Select all

http:// localhost: 8888/bluditrc3/bl-content/uploads/post-00.jpg
Check on the database, bl-content/databases/pages.php and look for the field coverImage.

Re: Thumbnails - bludit3

Posted: Mon Sep 17, 2018 12:23 pm
by bayerberg
the name is right but I need the thumbnail ;). $page->coverImage(false) should return the filename alone, without the full path, thats taken care of by . HTML_PATH_UPLOADS_THUMBNAILS. Whats a bit worrying is thumbCoverImage() returns the cover image, not thumbnail.

I'm fiddling with the header (seo, accessibility, AMP features), might have mangled something in there and thats why I have this issue. Will ping back if I find out why this happens.

Re: Thumbnails - bludit3

Posted: Mon Sep 17, 2018 1:28 pm
by bayerberg
Tested on one different setup, all ok. Figuring out why this issue occurs

Re: Thumbnails - bludit3

Posted: Mon Sep 17, 2018 2:00 pm
by bayerberg
this MAMP runs php 7.0.10 ...
can't spot any more significant differences.

Re: Thumbnails - bludit3

Posted: Mon Sep 17, 2018 2:54 pm
by diego
is strange, have you check the logs ?

Re: Thumbnails - bludit3

Posted: Mon Sep 17, 2018 3:29 pm
by bayerberg
at work - all clean, no issues
at home - need to get home to check :) will check later.

Re: Thumbnails - bludit3

Posted: Mon Sep 17, 2018 3:33 pm
by diego
Also, compare the database pages.php, the field coverImage.
Now I'm curious, maybe is a bug.