Item name result of two other value fields

More
9 years 5 months ago #51368 by cfrego
Hi,

Please can you help me

It is possible that the item name field be the result of two other fields junction?

I have two text fields (Marca (field17) and Modelo - (field18)) and I want that item name be Marca «space» Modelo.

Example:
Marca: Opel
Modelo: Astra
Name: Opel Astra

In this case I need not to fill the name field (It would populate automatically)

Can this be done? Suggestions

Thanks for all
Best Regards

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

More
9 years 5 months ago #51370 by ggppdk
Hello

is this for display purpose only ?

1. you can create a text field, with label "Name"

2. Set field to be "Form hidden" (at left of the field edit form) in both frontend and backend forms
==> you do not want this to be editable in the form

3. set a default value:
 

and configure the usage of the default, to be:
"The above and also display instead of empty"

4. in value prefix, use:
{{field17}} {{field18}



Note this can not be used as a filter since it has no values ... you will have to use the other 2 fields


-- 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
9 years 5 months ago #51383 by cfrego
Thanks for quick reply ggppdk,

Tell me something more...
That new field "Name" can replace the Title field joomla core or I'll have always give a title (even if not use) to a new item?
Other thing, it´s possible that new "name" in category view be a link to article view?

Best regards

Carlos

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

More
9 years 5 months ago #51387 by ggppdk
Hello

you will have to edit your FLEXIcontent template

and place the field around a link

before i tell you more, please study a little our templating tutorials


-- 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
9 years 4 months ago #51637 by cfrego
Hi ggppdk,

Since your last reply I created a field name "titulo" that is result of two others fields (marca and modelo).
I will use this field only in category view, but I that this field shoul be a link to that item in item view.
It is possible? How can do that?

Thanks

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

More
9 years 4 months ago #51641 by ggppdk
Hello

1. create a new field, by following instructions from here:
e.g. duplicate text field

How to Duplicate a Flexicontent Field to create a new Field Type


2. zip it and install via Joomla installer, then go to plugin manager and enabled it or relogin and visit FLEXIcontent backend and you will be asked to publish it


3. Use
Code:
function onDisplayField (...) { // execute the code only if the field type match the plugin type if ( !in_array($field->field_type, self::$field_types) ) return; $field->html = "automatic"; }


4.
Code:
function onDisplayField(...) { // execute the code only if the field type match the plugin type if ( !in_array($field->field_type, self::$field_types) ) return; if (!isset($item->fieldvalues)) { $itemmodel = new FlexicontentModelItem(); $item->fieldvalues = $itemmodel->getCustomFieldsValues($item->id); } $fieldA_vals = isset($item->fieldvalues[444]) ? $item->fieldvalues[444] : array(); $fieldB_vals = isset($item->fieldvalues[555]) ? $item->fieldvalues[555] : array(); $item_link = JRoute::_(FlexicontentHelperRoute::getItemRoute( $item->slug, $item->categoryslug, 0, $item )); $field->display = '<a href="'.$item_link.">' . $fieldA_vals[0]. " - ". $fieldA_vals[0] .'' }


After doing (and correcting) the above you can do any other manipulation that you need because you have a NEW FIELD TYPE)


-- now we are doing a highly anticipated feature field grouping that even allows grouping very COMPLEX fields e.g. image/gallery field with other fields (text, textarea, select, weblink, radio, radioimage, etc),



this discussion brings back the idea of a combination field which is surely a lot easier than the new field group feature !!


if you are you a developer then the above instructions should be relative easy to follow


-- 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.363 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