Template Override for "fieldgroup.php" System Plugin?

More
7 years 4 months ago - 7 years 4 months ago #74661 by Dave LeDev
Is it possible to create a template override for fieldgroup.php? It's located at:
\plugins\flexicontent_fields\fieldgroup\fieldgroup.php

I'm nearly certain it's this file I need to create an override for. The lines of code I'm looking to change are:
Code:
/*line 615*/   div class="fc-field-box"> '.($grouped_field->parameters->get('display_label') ? ' <span class="flexi label">'.$grouped_field->label.'</span>' : ''). (isset($grouped_field->{$method.'_arr'}[$n]) ? '<div class="flexi value">'.$grouped_field->{$method.'_arr'}[$n].'</div>' : '').' </div>';
I need to change the HTML a bit to enable some extra styling.

If not I could always clone the plugin, but then there will be some tedious upkeep on potential code changes.
Last edit: 7 years 4 months ago by ggppdk.

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

More
7 years 4 months ago #74675 by ggppdk
Hello

it exists already but as parameter

there is a parameter inside the viewing TAB of the fieldgroup, to enable custom HTML
- thus you can create the exact HTML that you need


-- 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 review. Thanks!

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

More
7 years 4 months ago #74681 by Dave LeDev
Very cool! I couldn't find one in a search; is there a reference sheet of commands that can be used, or is the tooltip with examples comprehensive?

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

More
7 years 4 months ago #74682 by Dave LeDev
Hm. Of the examples provided, only one seems to work: {{value##count}}

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

More
7 years 4 months ago #74686 by ggppdk
Hello

did you use exactly this text

{{fieldname}} ?

or did you use the real field name of field ?
e.g.
{{somefieldname}}


-- 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 review. Thanks!

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

More
7 years 4 months ago #74687 by Dave LeDev
The former: {{fieldname}} 

The assumption being that this is a position being used in a for-loop.

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

More
7 years 4 months ago - 7 years 4 months ago #74688 by ggppdk
Hello

you need to use the real field name
e.g. 'mygal' thus {{mygal}}
e.g. 'age'  thus {{age}}

e.g for and image gallery field with name 'mygal' you can use
{{mygal}}
or
{{mygal##single_total}}   (show a single thumbnail that will open up the gallery that show all other images, and will also show a total)
or
etc


-- 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 review. Thanks!
Last edit: 7 years 4 months ago by ggppdk.

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

More
7 years 4 months ago - 7 years 4 months ago #74694 by Dave LeDev
Hm. I may have to persist with a core edit. I'd have to create the markup necessary for every new field I make. And if I need to change it, I'll have to do it with however many fields I end up at the time. Currently 21 and rapidly growing!
Last edit: 7 years 4 months ago by Dave LeDev.

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

More
7 years 4 months ago - 7 years 4 months ago #74697 by ggppdk
Hello

sure regardless of custom display being possible already

we do need a good enough "default" display layout

so what about adding the a CSS class with fieldname
changing
Code:
<div class="fc-field-box">
to
Code:
<div class="fc-field-box field_' . $grouped_field->name . '">
thus you will have a unique class

plus i will move the PHP / HTML code of the loop to a layout file ... 
(same layout structure like other fields)
code will be move to
tmpl/value_default.php


-- 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 review. Thanks!
Last edit: 7 years 4 months ago by ggppdk.

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

More
7 years 4 months ago #74699 by ggppdk
Hello

ok moving value loop code to template file is as easy as any other field

done, this should benefit other users using the fieldgroup field

Please try v3.2.1.15-rc
github.com/FLEXIcontent/flexicontent-cck/releases

you can now duplicate layout file tmpl/value_default.php
customize new file
and then select the new layout file in field 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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
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
Save