Placeholder in an article

keianrad

Member
I have a form with 2 textarea fields: tx1 and tx2
The tx1 uses as admin note and the tx2 is filled out by autofill plugin. I need to add the tx1's content in middle of the tx2's content and send all content of tx2 by email to a user and only save tx1 in Db.

Is it possible?

Thank you for your help.
 
I think you'd have to do the email part with a PHP template.

And I think you can just set "Store in database" to "No" on the tx2 element.

-- hugh
 
I think you'd have to do the email part with a PHP template.

And I think you can just set "Store in database" to "No" on the tx2 element.

-- hugh

The problem that is, website is a multilingual so if I use PHP template how can I switch between templates? also there are more than 25 templates.
 
Use the JText API, with your language overrides.

Code:
echo JText::_('YOUR_LANGUAGE_TAG');

If you need to embed form data in a string, use sprintf ...

Code:
echo JText::sprintf('YOUR_TAG_WITH_VARIABLES', $foo, $bar);

... and use the %s convention in the tag itself. So in the language file ...

Code:
YOUR_TAG_WITH_VARIABLES="Dear %s,<br />Thank you for your application to %s.  Blah blah";

And in the template ...

Code:
echo JText::_('YOUR_TAG_WITH_VARIABLES', $this->emailData['yourtable___full_name'], $this->emailData['yourtable___school_name']);

See the J! docs:

https://docs.joomla.org/Formatted_fields_in_language_translation_strings

Note that JText::sprintf() also supports argument numbering, so if your different languages require the variables in different places in your tarnsalted string, for instance due to different grammatical rules ("La plume de ma tante" vs "My aunt's pen"), you can number them in the language override. See the last section on that page.

-- hugh
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top