[Added in v3.3.0+] Custom layouts for image field ?

More
6 years 9 months ago - 6 years 9 months ago #72384 by lipatovroman
Hello!
Is it possible to override template for image field?

I'm talking about this file: /plugins/flexicontent_fields/image/image.php
Last edit: 6 years 9 months ago by ggppdk.

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

More
6 years 9 months ago - 6 years 9 months ago #72385 by ggppdk
Hello

I'm talking about this file: /plugins/flexicontent_fields/image/image.php


in v3.2.x no


in v3.3.x yes,

the layout code was removed from file
Code:
/plugins/flexicontent_fields/image/image.php

and moved to layout files, 1 for every case

so in v3.3.0-dev

- we have added 1 custom layout per JS gallery
- every layout also can have its own XML parameters (see the new option of the slideshow-carousel layout in v3.3.0-dev)
- a different layout can be choosen for mobile !

you can just duplicate on of the 7 existing layouts and customize it, (do not forget to select it in image fields configuration)


-- 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...
Last edit: 6 years 9 months ago by ggppdk.

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

More
6 years 9 months ago #72389 by lipatovroman
Hello.

I need to change and add extra code to line
Code:
$alt_image_prefix = flexicontent_html::striptagsandcut($item->title, 60) . ' ' . JText::_('FLEXI_IMAGE') . ' ';

It placed in /plugins/flexicontent_fields/image/image.php

it not moved to to layout files.

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

More
6 years 9 months ago - 6 years 9 months ago #72390 by ggppdk
Hello

you do not need to change you can just not use it in your layout
i mean if you do not like, then search in files, copy the code to the layout and customize it


Code:
// FIND THIS LINE in the (image) VALUE loop your custom layout $result = include( JPATH_ROOT . '/plugins/flexicontent_fields/image/tmpl_common/prepare_value_display.php' ); // AFTER the above add the code you want to customize $alt_image_prefix = flexicontent_html::striptagsandcut($item->title, 60) . ' ' . JText::_('FLEXI_IMAGE') . ' '; $alt = ($usealt && isset($value['alt'])) ? $value['alt'] : $alt_image_prefix . ($n + 1); // Then e.g. for LARGE thumbnail $img_legend = '<img src="'.JUri::root(true).'/'.$srcl.'" alt="'.$alt.'"'.$legend.' class="'.$class.'" itemprop="image"/>'; $img_nolegend = '<img src="'.JUri::root(true).'/'.$srcl.'" alt="'.$alt.'" class="'.$class.'" itemprop="image"/>';

So you see you do not need to hack / modify / override the core file image.php

but i am not sure if it is worth creating a custom layout just for changing the ALT in the image,
in any case it is possible


-- 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...
Last edit: 6 years 9 months ago by ggppdk.
The following user(s) said Thank You: lipatovroman

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

More
6 years 9 months ago #72405 by lipatovroman
Can't understand how to create custom template.
I duplicated files

/biblsoft/data/www/biblsoft.ru/plugins/flexicontent_fields/image/tmpl/value_gallery_fancybox.php
/biblsoft/data/www/biblsoft.ru/plugins/flexicontent_fields/image/tmpl/value_gallery_fancybox.xm

and renamed them.

But they not appeared as new template in field settings...

Also I found custom layouts



But it's not clear how to use it and where they placed...

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

More
6 years 9 months ago #72406 by lipatovroman
Strange things...
After several page refreshes - my duplicated layout displays in settings

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 1.007 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