Add field manually in template

More
7 years 9 months ago #63146 by iorbita
Hi,
I create a new field type (a custom HTML field type), this field doesn’t appear in the template, I need to place it manually inside my template, precisely in “Description” position.
I read your doc about this operation but I really don’t understand how to proceed.
Could you please explain me through an exemple how to modify and insert this new field inside the item_html5.php file?

Another thing: I also noticed that new code inserted in item_html5.php file is cleaned after saving, in another words no changes are kept, why?

Thank you

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

More
7 years 9 months ago - 7 years 9 months ago #63174 by ggppdk
Hello

first please reply to this:
you mean you have "written PHP code" and created a new field type like this ??:

www.flexicontent.org/documentation/faq/7...-new-field-type.html

-- or do you want to "customize" the display of a field ? which field is it ? e.g. is it a "text" field ?


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

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

More
7 years 9 months ago #63193 by iorbita
Hello George,
I want to "customize" the display of a new field since this new field is not available in my template. This field is a custom HTML type.



In other words I have to display just simple text (they are questions) so this text should not be in fields, it must not be modifiable.
Yannick suggested me to add these fields directly in the template, I would like to display them precisely in “Description” position, so could you please explain me through an exemple how to modify and insert these new fields inside the item_html5.php file?
I guess I need to modify the “Insert template code” section?



Thank you again ;)

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

More
7 years 9 months ago - 7 years 9 months ago #63194 by ggppdk
Hello

the field that you tried to use is only for item form,
- it displays nothing in item / cateogory view


- The way to do it is to use "default value" in a text or textarea field:

1. Create a textarea field

2. At the left Tabset inside TAB: "Item Form" , set parameter "Form hidden" to be: "Both"
the above will hide field in both frontend and backend item forms

3. At the Left TAB-set , inside "Viewing" TAB, set parameter default value to the desired HTML
4. Set parameter "Value usage" to "Load instead of empty"
5. Add your field into a template position

PS:
i will change textarea.xml so that parameter "Default value" will appear as textarea so that it is bigger and easier to view / edit


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

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

More
7 years 9 months ago - 7 years 9 months ago #63239 by iorbita
Hello and sorry for the late reply ...

2. I think I misspoke. The fields must be visible but can not be editable so 'No' option is correct.

3. I guess you were referring to the Right TAB-set and not to the Left TAB-set … ;)
Anyway in the "Viewing" TAB I didn’t find the parameter "default value" and I didn’t found any configuration you gave me, it is rather in the "Editing" TAB that I find a similar configuration, and I configured this new textarea field as follows:





... I think it should be ok, but if you think that the setting is not correct please let me know ... thank you :)
Last edit: 7 years 9 months ago by iorbita.

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

More
7 years 9 months ago #63242 by ggppdk
Hello

it is good, also set your field to be "form hidden" ?
- parameter is at the left TABset


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