Thumbnails - bludit3

User avatar
bayerberg
Master Bludit
Posts: 66
Joined: Wed Jun 07, 2017 1:05 pm

Sun Sep 16, 2018 12:14 am

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 :)
i do things, check them out on behance | check out startups undiluted - london's startup ecosystem
User avatar
diego
Site Admin
Posts: 695
Joined: Sat May 16, 2015 2:53 pm
Contact:

Sun Sep 16, 2018 6:59 pm

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());
?>
User avatar
bayerberg
Master Bludit
Posts: 66
Joined: Wed Jun 07, 2017 1:05 pm

Mon Sep 17, 2018 12:41 am

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
i do things, check them out on behance | check out startups undiluted - london's startup ecosystem
User avatar
diego
Site Admin
Posts: 695
Joined: Sat May 16, 2015 2:53 pm
Contact:

Mon Sep 17, 2018 9:49 am

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.
User avatar
bayerberg
Master Bludit
Posts: 66
Joined: Wed Jun 07, 2017 1:05 pm

Mon Sep 17, 2018 12:23 pm

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.
i do things, check them out on behance | check out startups undiluted - london's startup ecosystem
User avatar
bayerberg
Master Bludit
Posts: 66
Joined: Wed Jun 07, 2017 1:05 pm

Mon Sep 17, 2018 1:28 pm

Tested on one different setup, all ok. Figuring out why this issue occurs
i do things, check them out on behance | check out startups undiluted - london's startup ecosystem
User avatar
bayerberg
Master Bludit
Posts: 66
Joined: Wed Jun 07, 2017 1:05 pm

Mon Sep 17, 2018 2:00 pm

this MAMP runs php 7.0.10 ...
can't spot any more significant differences.
i do things, check them out on behance | check out startups undiluted - london's startup ecosystem
User avatar
diego
Site Admin
Posts: 695
Joined: Sat May 16, 2015 2:53 pm
Contact:

Mon Sep 17, 2018 2:54 pm

is strange, have you check the logs ?
User avatar
bayerberg
Master Bludit
Posts: 66
Joined: Wed Jun 07, 2017 1:05 pm

Mon Sep 17, 2018 3:29 pm

at work - all clean, no issues
at home - need to get home to check :) will check later.
i do things, check them out on behance | check out startups undiluted - london's startup ecosystem
User avatar
diego
Site Admin
Posts: 695
Joined: Sat May 16, 2015 2:53 pm
Contact:

Mon Sep 17, 2018 3:33 pm

Also, compare the database pages.php, the field coverImage.
Now I'm curious, maybe is a bug.
Post Reply