-->
Welcome, Guest
Username: Password: Remember me

TOPIC: Default Module Development & Hello World Example

Default Module Development & Hello World Example 1 week 6 days ago #38396

  • da2310
  • da2310's Avatar
  • OFFLINE
  • Newcomer
  • Posts: 7
  • Thank you received: 1
  • Karma: 0
Hi everyone, I feel stupid asking this, but I can't seem to wrap my head around the flow of the custom modules. Maybe it's just lack of sleep, but I feel like I'm missing something obvious here. I'm comfortable writing LAMP code, but I'm missing how the hierarchy of modules works apparently. I'm using version 10.0.1 on a Linux cPanel server. I've read through the Module development wiki and I can't seem to find what it is. I've been able to create new custom modules using the module builder, but it always shows the home page layout after activating the new module and then going to that module from the top menu. It also defaults to whatever the last left menu was showing from other previously shown modules, which tells me I'm not setting the left menu either.

I believe that the home page layout must be the default layout for modules when nothing else is setup yet, but every file I try to edit to find one that controls that layout goes no where. I realize it could be either/or/both that I'm using the wrong syntax or editing the wrong file(s). So I'm hoping someone can just get me started with changing that default to a Hello World page and how to change the menus on the left. I don't mean point me to the wiki either. There are things that don't match my install versus the wiki. I keep seeing mention of htdocs directory, but I have yet to come across that directory on the version I installed. I do see it in the online repository, but not in my version.

I sincerely mean no disrespect to the awesome developers of Dolibarr! I'm really impressed with the overall system. It's just for someone new to developing for it, it is really hard to follow the flow when there is no guide explaining what each element of the modules do/control as well as best practices for editing them. I'm sure to an experienced Dolibarr developer this seems trivial, but I'm going down the rabbit hole directory by directory and file by file and getting nowhere. I even intentionally broke the PHP syntax in the new custom module index file (under custom/MyTestModule1 directory) and it didn't throw an error. It just showed that same default home page layout. Clearly I'm not editing the correct file(s).

What would really help me and hopefully some other Dolibarr developer newbies is a few really basic examples that we could reverse engineer. That and slightly more in depth notes on what to edit on modules showing some very basic changes like the Hello World text in one, creating some custom layout boxes on the first page of a module, creating additional pages and linking to them (could even be more Hello World pages in example) . I am guessing from what I've read that one of the sql files creates (just haven't got that far yet) tables for the module if it doesn't exist already. I am also unclear on the best approach to creating a custom web form to use with the CRUD setup. I can certainly just write one from scratch, but I get the impression there are built in options for doing that too.

Thank you in advance to anyone who can point me in the right direction on any of this. Again, I feel really dumb having to ask this, but maybe it will help others new to Dolibarr too. Thank you in advance! :)
The administrator has disabled public write access.

Default Module Development & Hello World Example 1 week 5 days ago #38398

  • ksar
  • ksar's Avatar
  • OFFLINE
  • Moderator
  • Posts: 324
  • Thank you received: 86
  • Karma: 14
Hi,

What a looooooooooooonnnnnnnnnnng text :woohoo:

What exactly is your problem ?
htdocs is the default root directory of the dolibarr, it could be another name on your system no problem.

The best way to learn how it is working : Go to Dolistore, download free module that has the required code and read !
Last Edit: 1 week 5 days ago by ksar.
The administrator has disabled public write access.
The following user(s) said Thank You: da2310

Default Module Development & Hello World Example 1 week 5 days ago #38399

  • da2310
  • da2310's Avatar
  • OFFLINE
  • Newcomer
  • Posts: 7
  • Thank you received: 1
  • Karma: 0
Okay I should have realized the htdocs was the root directory of the install. :)

I didn't realize/remember there were free modules in Dolistore, so that should be enough for me to look at and experiment with.

Like I said, lack of sleep. And sorry for the long text.

Thank you for helping ksar!
The administrator has disabled public write access.
The following user(s) said Thank You: ksar
Time to create page: 0.067 seconds