$this->category->image est vide

More
11 years 6 months ago #29069 by Hableur

Is showing of category image enable in category options?

Yes (of course ;) ).

The problem is in conditions
Code:
if ( $cat_image_source && $cat->image && JFile::exists( JPATH_SITE .DS. $joomla_image_path .DS. $cat->image ) ) { $src = JURI::base(true)."/".$joomla_image_path."/".$cat->image; $h = '&h=' . $cat_image_height; $w = '&w=' . $cat_image_width; $aoe = '&aoe=1'; $q = '&q=95'; $zc = $cat_image_method ? '&zc=' . $cat_image_method : ''; $ext = pathinfo($src, PATHINFO_EXTENSION); $f = in_array( $ext, array('png', 'ico', 'gif') ) ? '&f='.$ext : ''; $conf = $w . $h . $aoe . $q . $zc . $f; $image = JURI::base().'components/com_flexicontent/librairies/phpthumb/phpThumb.php?src='.$src.$conf; } else if ( $cat_image_source!=1 && $src = flexicontent_html::extractimagesrc($cat) ) {

$cat_image_source is equal to 0, so instructions in first "if" are not done. If I rewrite the condition as :
Code:
if ($cat->image && JFile::exists( JPATH_SITE .DS. $joomla_image_path .DS. $cat->image ) )
it's work.

In second "if",
Code:
else if ( $cat_image_source!=1 && $src = flexicontent_html::extractimagesrc($cat) ) {

flexicontent_html::extractimagesrc($cat) is empty. So instructions in the second "if" are not played. I have tried to change $src = flexicontent_html::extractimagesrc($cat) with $src == flexicontent_html::extractimagesrc($cat), but it doesn't work.

From where come this :
Code:
// category image $show_cat_image = $params->get('show_description_image', 0); // bad named maybe $cat_image_source = $params->get('cat_image_source', 0); $cat_link_image = $params->get('cat_link_image', 1); $cat_image_method = $params->get('cat_image_method', 1); $cat_image_width = $params->get('cat_image_width', 80); $cat_image_height = $params->get('cat_image_height', 80);

Only in J2.5 perhaps ?

Thanks.

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #29070 by Hableur
:o Oh, it seems it's necessary to tell flexi the size of the category's img now ! :shock:

If I don't write the right width and height, the category's img is deformed !

Why this ? Why flexi isn't able to know himself the size of category's img ???

Have I to rewrite all my parameters for my categories' img ?

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #29074 by ggppdk
ok, the problem is not
if ( $cat_image_source && $cat->image && JFile::exists( JPATH_SITE .DS. $joomla_image_path .DS. $cat->image ) ) {


-- The default value above for category image source: cat_image_source

should be 2 instead of 0 like it is in the category.xml file, this effects categories saved with older FLEXIcontent versions, that did not have this parameter. (same change needed in Directory view)


-- About image resizing,
the default sizes are 80x80, and resizing method is "crop", so the smaller dimension is scaled and then the larger dimension is cropped,
so your images should not be deformed, they should be cropped, right?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago - 11 years 6 months ago #29076 by Hableur
Hello,

with
Code:
$cat_image_source = $params->get('cat_image_source', 2);
it's work !
Thanks.

But where this parameter is in bdd ? I don't find it.

About size of image.

All my 87 images for categories are 100 X 83.
With old version, I don't have to tell Flexi the size and images where correctly played with css properties widht et height.

Now, if I don't want my images to be cropped or deformed (and I don't want, that sure !), i'have to manually modify the width and the height of image in each category. It would be easier if flexi take width and height of the original image for default width en height when in "use image parameter" mode.

Thanks
Last edit: 11 years 6 months ago by Hableur.

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #29078 by Hableur

But where this parameter is in bdd ? I don't find it.


Sorry, i have read your post too quickly :? .

(same change needed in Directory view)

In wich file ?

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #29084 by ggppdk
See the change for directory view here


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.294 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline