Tweaked mod_custom to use input field (instead of text editor)

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
EvanGR
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 232
Joined: Fri Oct 10, 2008 5:30 pm
Location: Greece

Tweaked mod_custom to use input field (instead of text editor)

Post by EvanGR » Wed Apr 29, 2020 10:56 am

Hello,

I am trying to create a clone of mod_custom module.
I want a similar module, which only has a basic HTML input field, and accepts only a line text (no HTML).

I have cloned and renamed mod_custom, but I don't know where the admin input page is defined, so I can change it. Any help?

Thanks

 
User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 12366
Joined: Thu Feb 15, 2007 5:48 am
Location: Suzhou, China

Re: Tweaked mod_custom to use input field (instead of text editor)

Post by toivo » Sat May 16, 2020 3:35 am

If the module is expected to accept data from an input field in an HTML form, what will happen to that data? Will the data get posted to a particular component for processing? That sounds more like a design for a new component.
Toivo Talikka, Global Moderator

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1713
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Tweaked mod_custom to use input field (instead of text editor)

Post by SharkyKZ » Sat May 16, 2020 6:58 pm

Normally content field is added using <customContent/> and com_modules has special handling for that. You can create a field named content outside of params field group instead. Just note that this may not be reliable.

Code: Select all

<fieldset name="example" label="MOD_EXAMPLE_FIELDSET_EXAMPLE">
	<field
		name="content"
		type="text"
	/>
</fieldset>
<fields name="params">
	// Your param fields here.
</fields>

EvanGR
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 232
Joined: Fri Oct 10, 2008 5:30 pm
Location: Greece

Re: Tweaked mod_custom to use input field (instead of text editor)

Post by EvanGR » Wed May 27, 2020 8:39 am

Thank you both for the replies.

The intent was to have custom input fields, and store the data in the database. I don't need a component, just a simple module with custom input fields (backend).

Is there a specific guide/tutorial I need to follow for this?

Thanks

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 12366
Joined: Thu Feb 15, 2007 5:48 am
Location: Suzhou, China

Re: Tweaked mod_custom to use input field (instead of text editor)

Post by toivo » Wed May 27, 2020 10:09 am

EvanGR wrote:
Wed May 27, 2020 8:39 am
The intent was to have custom input fields, and store the data in the database. I don't need a component, just a simple module with custom input fields (backend).
Modules present data, text and images on the web page. They can also display a form. However, if you want the form to accept data, the form has to be able to forward the data to a URL in the web server for action. Functions behind such a URL can first validate the data before the data is stored in the database. Data validation and storage functions in Joomla are provided by components.

Have you looked at the Forms section in Joomla Extensions Directory (JED)?
Toivo Talikka, Global Moderator

 

Post Reply

Return to “Extensions for Joomla! 3.x”