hide field into frontend form and set default value

More
12 years 5 months ago #25599 by samuel.petit
Hello,

I would like to hide a field (eg myfield) into an item creation form and set a default value to this field.
I have read flexicontent.org/documentation/f ... -form.html
but i don't know where to put myfield.xml file.

I have tried to configure default value using parameter "Default value" of my field but it does not seem to work :cry:

Could you please help me ?

I am using Joomla! 2.5.4 and Flexicontent 2.0 RC5 (r1315).

Thanks and regards,
Samuel

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

More
12 years 5 months ago #25610 by micker
svp c'est le forum en fr tu veus que je le deplace ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
12 years 5 months ago #25612 by ggppdk
Default value e.g. for a text field will work only if field is not hidden.

You will then have to duplicate the text fields
and modify both files:
-- myfield.xml for setting the parameter that hides the field in the frontend
-- myfield.php that will use the default value not in the form only but also if no value is POSTED from the form.

A simpler solution would be to create a Joomla template override for the frontend item edit form that checks the fields outputted in the frontend and when this field is found, it is put inside a hidden html div tag

For these you will need the help of a developer

But your comment gives me a hint that we need a named id parameter for every field of item edit from.

I ll put this id to the loop that output the fields so that you can hide the field with a single CSS rule.

You can do it now:
change line
of components/com_flexicontent/views/item/tmpl/form.php

Code:
<td class="fcfield-row" style='padding:0px 2px 0px 2px; border: 0px solid lightgray;'>
to
Code:
<td id="fcfield-row_<?php echo $field->id; ?>" class="fcfield-row" style='padding:0px 2px 0px 2px; border: 0px solid lightgray;'>

And add to one of your CSS files, e.g. to your joomla CSS file template.css
#fcfield-row_45 { display:none; }

WHERE 45 is the id of your field !!!

Regards


-- 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
12 years 4 months ago #27012 by ggppdk
I have added property to hide ANY field in frontend / backend edit form, (the xml parameter used for this will be abandoned)

also maybe there will be a property editvalue to allow specific user group to edit a field in the item form, e.g. the have bought privilege to list their items with some extra 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
12 years 3 months ago #27027 by micker
cool thanks

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

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