(Solved) Default title on new item form...how?

More
10 years 10 months ago - 10 years 10 months ago #48645 by alitogata
Hello,

Is there any way since I can't get rid of title in Item Creation Form (frontend) to at least have a default value through triggering (e.g. item id) when someone creates an article?

The triggering shows but only after form is saved and won't let me save any form without putting a title and there is no default option like in other fields :?

FLEXIcontent v3.1.0-rc2
Joomla! 3.6.2
Last edit: 10 years 10 months ago by alitogata.

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

More
10 years 10 months ago #48649 by micker
at first you can override form.php in your template

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
10 years 10 months ago #48669 by ggppdk
Hello

every content type have parameters to add JS to the item form:

for example, the following code checks if the form field is empty, and if it is, then it adds some default text:
Code:
jQuery(document).ready(function(){ if (jQuery('#jform_title').val() == '') { jQuery('#jform_title').val('This is the default title'); } });



--> , you may try[/to use language stringsu]:


1. add your index.php:
Code:
JText::script("MY_DEFAULT_TITLE", true);


2. Add the language "MY_DEFAULT_TITLE" string via Joomla language overrides manager (google this to find how to use it)

3.
replace line:
Code:
jQuery('#jform_title').val('This is the default title');
with:
Code:
jQuery('#jform_title').val(Joomla.JText._('MY_DEFAULT_TITLE'));


-- 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
10 years 10 months ago #48673 by alitogata
Thank you very much, I'll try this

FLEXIcontent v3.1.0-rc2
Joomla! 3.6.2

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

More
10 years 10 months ago #48690 by alitogata
As I am way more than a newbie on this :lol:

I tried to add the code
Code:
jQuery(document).ready(function(){ if (jQuery('#jform_title').val() == '') { jQuery('#jform_title').val('This is the default title'); } });

on one of my types to the field "Add JS to edit form" (tried on all Frontend, Backend, Frontend and Backend)but when I save the type it keeps only the following code:
Code:
jQuery(document).ready(function(){

FLEXIcontent v3.1.0-rc2
Joomla! 3.6.2

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

More
10 years 10 months ago #48698 by ggppdk
Hello

try using

\'

instead of

'


-- 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.854 seconds
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