Jump to content

Recommended Posts

Posted

Hey everyone,

I'm excited to share my first module WesanoxFrameworkPackage — built to simplify my workflow and experiment with some ideas.

Description:

Included Frontend Libraries - These libraries are bundled and loaded automatically (if the files exist):

AOS 2.3.1, Swiper 11.2.6, Bootstrap 5.3.3, jQuery 3.7.1

All files are stored in the module’s internal /styles/ and /scripts/ folders.

How to Use

Add the following lines to your template files:

// Outputs <link> tags for CSS assets
echo $modules->WesanoxFrameworkPackage->renderStyles();

// Outputs <script> tags for JS assets
echo $modules->WesanoxFrameworkPackage->renderScripts();

I'm always happy to improve things, so feel free to share your thoughts or ideas — and thanks in advance for any support. 🙂

Edit:

I missed the links – I'm sorry:

https://processwire.com/modules/wesanox-framework-package/

Github:

https://github.com/wesanox/WesanoxFrameworkPackage.git

  • Like 3
  • Haha 1
Posted

Hi nice post. Just missing the content somehow. Would be nice to post a link to the PW modules directory with your module or at least to your Github (or similar VCS) repository. But the code examples look great by the way 🙂

  • Like 1
Posted

Hey @wesanox congrats on your first module 🙂 

I just had a very quick look and saw that your module is "autoload": https://github.com/wesanox/WesanoxFrameworkPackage/blob/b50d538b48f295133cf654838b6002cd0c006c4a/WesanoxFrameworkPackage.module#L19

Autoload means that it loads on each and every request even if you don't use it. I think you don't need this in your case. On the frontend you request it with $modules->WesanoxFrameworkPackage anyhow and on the backend I guess you don't need your module to be loaded?

Oh, and I think this line is also not needed 🙂 It only tells PHP that "implements Module" refers to "Module" in the ProcessWire namespace. But since you have "namespace ProcessWire" at the top of your file "implements Module" will be enough, because no use statement means it will use the namespace of the file, which is ProcessWire.

  • Like 1
Posted

Hey @bernhard,

thank you for your input and for taking a deeper look into my module. I’ve adopted your suggestions right away.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...