1
johny
Contact module hack
  • 2003/11/7 15:40

  • johny

  • Just popping in

  • Posts: 23

  • Since: 2003/8/25


I have reaally a simple wish but I can't figure it out by myself.

I'd like to tweak the standard Contact module that comes with Xoops. All I want is to display additional information (instructions and alternate ways of contacting) below the form. If I simply edit the templates/contact_contactusform.html I get the desired result BUT I'd like to offer that information in two languages - depending on the language selected by the user.

That's where it gets trickier. It seems that I cannot call a translation directly from that file. I might also be wrong. I'd really appreciate if someone helps me out here.

2
Hober
Re: Contact module hack
  • 2003/11/7 16:37

  • Hober

  • Just popping in

  • Posts: 40

  • Since: 2003/6/13


Define the message as a constant in the language files of the two languages you want, then call that constant from the module.

3
johny
Re: Contact module hack
  • 2003/11/8 16:58

  • johny

  • Just popping in

  • Posts: 23

  • Since: 2003/8/25


I've done that but the problem is that I don't know how (and in which file) to call it.

I just switched to XOOPS (from Nuke) and I need to adjust

4
Catzwolf
Re: Contact module hack
  • 2003/11/9 6:45

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Quote:

johny wrote:
I've done that but the problem is that I don't know how (and in which file) to call it.

I just switched to XOOPS (from Nuke) and I need to adjust


In modules/contact/language/yourlanguage

Edit the main.php file and you can add a constant like

define('_MD_MYNEWCONSTANT', 'My new constant define');

Remeber you will copy and paste into each language for it to work with the lang change..

You may also like to to know that there is a mult-lang hack going around somewhere that could possibly help you in some way

Welcome to XOOPS and hope you enjoy

5
johny
Re: Contact module hack
  • 2003/11/11 13:34

  • johny

  • Just popping in

  • Posts: 23

  • Since: 2003/8/25


Thanks for the instructions. I actually know that already since that is the case with all such systems. The problem is that usually these strings are called from one file and are defined in language files. That's easy to modify and I can do that with no fuss.

If you take a look at the Contact module files, however, you'll see that they are not so easily configured. I believe I added the string to the template file and updated the module but I only got the string displayed, not the actual text defined in the language files. If I enter - hardcode - normal text in the file, it gets displayed but I'd really need that to work multilingual.

I might have called the string incorrectly; I used several types of calling it. I took a look at other files and copy-pasted those, modified that, and it still didn't work. Please take a look at this particular module and try to advise which file needs modifying and how to call the language variable.

Please help - I'm still confused here

Login

Who's Online

131 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 131


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits