andrewscaya / mod_simpleemailform

Joomla module: mod_simpleemailform
http://joomla.unlikelysource.org/
GNU General Public License v2.0
3 stars 4 forks source link

The question of styling the module using mod_simpleemailform/tmpl/default.php #21

Closed Akela-SF closed 6 years ago

Akela-SF commented 7 years ago

Now the module works on the table styles. But I would like to apply the Bootstrap-3/4 markup. What data should I put into /tmpl/default.php to get the bootstrap markup?

andrewscaya commented 7 years ago

@Akela-SF --

We urge you to upgrade to Simple Email Form (SEF), version 2.0, with the new 'JForm' setting, in order to use the built-in Joomla templates with Bootstrap. You would then customize the CSS classes that are used within the Joomla JForm elements as you would for any other HTML element contained in a Joomla template (https://docs.joomla.org/J3.x:Modifying_a_Joomla!_Template).

Hope this answers your question. If not, please do not hesitate in writing back to us!

Best regards,

Andrew Caya

Akela-SF commented 7 years ago

Suddenly, a quick response! Thank you!

I'm using jumble-3.8.2 + mod_simplemailform-Version 2.0.1 with the "JForm" setting and it works fine.

But I can not change the markup

<table class = "mod_sef_table"> <tt class = "mod_sef_tr"> <td class = "mod_sef_td">
 to   <div class = "form-group">

because mod_simpleemailform/tmpl/default.php actually empty. And to change the main code of the module to me it is terrible, so as badly I know PHP

andrewscaya commented 7 years ago

@martinbeaudry --

Could you please have a look at this question? If we have an underlying bug, I'll include the bug fix in the next release (v 2.1) which should be out before the Holidays.

Many thanks for your time and efforts, my friend!

Andrew

martinbeaudry commented 7 years ago

Yes, I'll have a look at it.

My pleasure!

martinbeaudry commented 6 years ago

@Akela-SF - I think there are three possible solutions.

The simpler one would be to copy the Joomla template you're using (see the link provided above by Andrew) and edit its CSS files:

  1. In the main menu, click on Extensions >> Templates >> Styles
  2. In the "Template" column, click the name of the template that renders your form.
  3. If you use a custom template, you can start editing it right away. Otherwise, click on the "Copy Template" button. (You need to edit a copy of the Joomla template to make sure you won't lose your changes at the next upgrade.)
  4. Close the current template and, using the same method, open the template you just created.
  5. I would recommend creating a user.css file if you don't already have one.
  6. You can now start editing your form using the mod_sef_table class, for instance.

Another solution would give you more control, but might be slightly more complicated:

  1. In the simpleemailform's interface, click on the "Advanced" tab and select "Override rendering" >> Yes
  2. Open mod_simpleemailform/tmpl/default.php
  3. At the very end of the file, add the php closing tag: ?>
  4. Copy your form's current html code and paste it at the end of default.php.
  5. You can now change the name of the table, td and tr classes as you see fit. Please note, however, that the names and ids (e.g. _SimpleEmailForm_1) must remain intact to keep all of simpleemailform's functionalities. Some class names should also be left as is. For instance, changing "validate-email" would remove client-side validation.

Version 2.1 of simpleemailform will make it easier to change the form's rendering using PHP. We hope it will be available a few weeks from now.

Good luck, and thanks for using simpleemailform!

andrewscaya commented 6 years ago

@martinbeaudry --

Just pre-released beta4 with the fix for this issue.

Many thanks for bringing up the problem of the missing interface file after module deployment!

Yours,

Andrew