Thumbnails - bludit3

User avatar
bayerberg
Master Bludit
Posts: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 7 times
Been thanked: 10 times
Contact:

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 :)
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

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: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 7 times
Been thanked: 10 times
Contact:

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
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

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: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 7 times
Been thanked: 10 times
Contact:

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.
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
User avatar
bayerberg
Master Bludit
Posts: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 7 times
Been thanked: 10 times
Contact:

Tested on one different setup, all ok. Figuring out why this issue occurs
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
User avatar
bayerberg
Master Bludit
Posts: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 7 times
Been thanked: 10 times
Contact:

this MAMP runs php 7.0.10 ...
can't spot any more significant differences.
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

is strange, have you check the logs ?
User avatar
bayerberg
Master Bludit
Posts: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 7 times
Been thanked: 10 times
Contact:

at work - all clean, no issues
at home - need to get home to check :) will check later.
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

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