Jump to content
Sephiroth

Writing a tutorial on Module Development in Processwire

Recommended Posts

Hi guys so currently am writing a detailed tutorial about creating Modules, I have never created a module because i don't know all the classes and interfaces required, so this is like a detailed research for me, this is how i learn things by writing articles. However I might make some mistakes so i decided to make it on Google Docs to get comments and feedback, before posting on my website and Processwire tutorial site, this is going to be one heck of a detailed tutorial.

Here is the link I will be updating it 

https://docs.google.com/document/d/1VA_WK-5qbnq3Ux_EOW3p92IcjbAcVZJ0aewIiFxmv2Q/edit#

However I wanted to get a clear picture of the following

Process Class and ConfigurableModule i noticed some modules require it and some don't 

My interpretation is that Modules with admin setting pages uses ConfigurableModule and Process are modules who require access to $this->pages and that sort Thanks all 

 

  • Like 13

Share this post


Link to post
Share on other sites

Hi Sephiroth,

I'm not a professional module developer, but a person from your target group :) So my suggestions are from the "beginner's point of view", and are as follow:

  • You probably want to clean it up by fixing typos, missing spaces, extra spaces and similar errors.
  • When referring to code, you might want to copy stuff instead of typing, so ProcessPageImageEditSelect  vs. ProcessPageEditImageSelect is spelled right, out of the box.

You might also want to list the following resources:

What really bugs me is the fact that Ryan has already documented so much in the blog, but it is really hard to find what one is looking for. It often occurs to me that I know I've read something in the blog, I just do know know were... We have tons of useful info buried in the blog.

Nice incentive anyway, keep it up!

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
9 minutes ago, szabesz said:

Hi Sephiroth,

I'm not a professional module developer, but a person from you target group :) So my suggestions are from the "beginner's point of view", and are as follow:

  • You probably want to clean it up by fixing typos, missing spaces, extra spaces and similar errors.
  • When referring to code, you might want to copy stuff instead of typing, so ProcessPageImageEditSelect  vs. ProcessPageEditImageSelect is spelled right, out of the box.

You might also want to list the following resources:

What really bugs me is the fact that Ryan has already documented so much in the blog, but it is really hard to find what one is looking for. It often occurs to me that I know I've read something in the blog, I just do know know were... We have tons of useful info buried in the blog.

Nice incentive anyway, keep it up!

Interesting, Thanks for the comment, yeah it seems most of the content are not consolidated, it's the same issue i've been facing when trying to create a Module, I noticed some information were scattered in different places, so this will be go-to guide, thanks for the corrections. I will update the name i was typing it out and along the line i must have missed the proper name.

Will include those resources. 

  • Like 1

Share this post


Link to post
Share on other sites

I forgot to attach a file from the old (no longer online) ProcessWire Wiki, just in case you do not have a copy of it. This is somewhat outdated, but you might still find useful info in it. See: "Module Creation - Wiki.html.zip" 

Module Creation - Wiki.html.zip

  • Like 1

Share this post


Link to post
Share on other sites

Looking very good! Can't wait to get see the rest! I like that it includes Vuejs as a bonus, I've been meaning to learn some, and fitting it into the ProcessWire context is wonderful.

Share this post


Link to post
Share on other sites

Hi Sephiroth.

Great start! I have been searching for an in-depth tutorial on creating modules so I was delighted to find this thread linked in ProcessWire Weekly.

I started reading and adding comments for grammar and spelling and realized it would be much faster if I was able to actually edit the doc. So, I am officially offering my services as an Editor for your document. I figure this would be a great way for me to contribute back to this awesome community and help you help me learn how to write PW modules.

If you are interested, let me know and we can go from there.

Continue the great work!

  • Like 6

Share this post


Link to post
Share on other sites
4 hours ago, artaylor said:

Hi Sephiroth.

Great start! I have been searching for an in-depth tutorial on creating modules so I was delighted to find this thread linked in ProcessWire Weekly.

I started reading and adding comments for grammar and spelling and realized it would be much faster if I was able to actually edit the doc. So, I am officially offering my services as an Editor for your document. I figure this would be a great way for me to contribute back to this awesome community and help you help me learn how to write PW modules.

If you are interested, let me know and we can go from there.

Continue the great work!

Thanks for your comments, I saw them i really love to apologize to everyone, I got sidetracked by a big project in the office but am working on continuing the rest and yes VueJs is part of it 

  • Like 3

Share this post


Link to post
Share on other sites
19 hours ago, artaylor said:

Hi Sephiroth.

Great start! I have been searching for an in-depth tutorial on creating modules so I was delighted to find this thread linked in ProcessWire Weekly.

I started reading and adding comments for grammar and spelling and realized it would be much faster if I was able to actually edit the doc. So, I am officially offering my services as an Editor for your document. I figure this would be a great way for me to contribute back to this awesome community and help you help me learn how to write PW modules.

If you are interested, let me know and we can go from there.

Continue the great work!

can you send your email so i can add you as a collaborator, however i think it's public and anyone can edit. Thanks alot for the support

Share this post


Link to post
Share on other sites
On 3/10/2017 at 10:41 PM, jmartsch said:

Thank you for this great article. It should be in the official ProcessWire Docs.

Thanks I didn't even see this comment, I had plains of re-writing, I think i went too far going with something too complex without best practice so working to change the tutorial to start with something small like fetching API from Reddit to build a widget. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By cosmicsafari
      Hi all,
      I have been asked by a client whether we can setup load balancing for their existing Processwire site.
      From my investigations on Google and within these forums, it definitely seems possible but as a newbie with a basic understanding of the subject im a bit lost.
      Does anyone know of any existing tutorials for settings up load balancing with PW?
      What items would need to be changed on their current stand alone install, is there a list of best practices worth consulting etc?
      As I understand it we would need to have some sort of copying mechanism (rsync script most likely) in order to make sure any uploaded assets are shared between the main server and the fallback ones, other than that im not sure what else would need to be ammended.
      Any thoughts/help would be greatly appreciated.
    • By Sten
      Hello,
      I'd like to participate to a documentation about the page flow in PW. I am still a beginner and still have difficulties to see the big picture but I could help to the writing.
      What is the flow when a page is displayed or created ? It would be fine to draw a scheme with every stage in which one can add hooks. Something to describe the flow in time.
      May be it exists.
      page
      |
      fields
      |
      template
      What do you think ?
    • By EyeDentify
      Simple example for loading template specific CSS file.
      This example asumes that you have your CSS file in a directory relative to template root.
      Like:
      templates/css/my_template_specific.css
      Also i use in the template a simple text field to hold the name of the CSS file i want to load.
      I call this field 'css_file'
      Use what you feel comfortable with.
      So in your header section of the DOM notice the "page specific CSS" part?
      Thats were the magic happens. What happens is that we check to see if the file exists in the CSS dir relative to template root.
      And if it does we load it. Simple and effective.
      I load all other CSS that is used all over the site in global_styles.css first.
      And make sure you load template specific last, because then you can easily override CSS in global.
       
      DOM header example:
      <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title><?PHP echo($page->title); ?></title> <!-- main CSS --> <link rel="stylesheet" href="<?PHP echo($config->urls->templates); ?>css/global_styles.css"> <!-- page specific CSS --> <?PHP /* Use relative path in file_exists() */ if(file_exists('css/' . $page->css_file)) { echo("<link rel=\"stylesheet\" href=\"{$config->urls->templates}css/{$page->css_file}\">"); } ?> </head> <body> Thats my way of doing it. I am sure there is plenty of more ways to do it. This is for the newbies or anyone that wants more options.
      Good luck with your CSS out there in Cyberspace.
      Cheers from EyeDentify
    • By ARG
      Hello, I am completely new at PW, (and Php) coming from another CMS.  I decided to try to understand the beast, before crafting anything.
      So, I started  from the beginning: the simple web site tutorial.
      I am trying to output the Home page with Head and footer included in. 
      Here is my Home page code:
      include("./includes/head.inc.php"); echo "<h1>{$page->title}</h1>"; include("./includes/scripts.inc.php"); include("./includes/foot.inc.php"); Here is my  Head.inc.php code:
      <?php require_once("./includes/functions.inc.php"); ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="<?php echo $pages->get("/site-settings/")->site_meta_description; ?>"> <title><?php echo $pages->get("/site-settings/")->site_meta_description;?></title> <link rel="stylesheet" href="<?php echo $config->urls->templates?>css/simplegrid.css" /> <link rel="stylesheet" href="<?php echo $config->urls->templates?>css/site.css" /> </head> <body> And this the message I got, when I try to view my page:
      Compile Error: require_once(): Failed opening required 'C:/wamp64/www/processwire-master/site/templates/includes/includes/functions.inc.php' (include_path='.;C:\php\pear') (line 1 of C:\wamp64\www\processwire-master\site\assets\cache\FileCompiler\site\templates\includes\head.inc.php)
      Any advice would be helpful
      Thank you for your time.
       
    • By benbyf
      HELLO ALL!
      Context: I use serverpilot to setup and administrate my server patches for my hosted sites. As with many other serving companies, they write tutorials to setup software on their service. I asked them to provide a PW installation instruction and they have obliged however hitting on the following issue on installation with their default linux user:
      Issue:
       
      Basically at the end of the installation there is a warning to secure your config file which could have been done already by the system, I believe they're saying. Is there anything we can do with this, or should i ask them to carry on with the caveat that they should but in a bit of text saying this warning is normal and can be sorted in teh follow ways etc...?
      Interested in people's opinion.
×
×
  • Create New...