Jump to content

Extend/modify a core module


Recommended Posts

Hello All,

I need to make some style editing in the core module - FieldtypeComments

But I dont want to edit in the Core itself, since it may got overwritten for the next update or so. so I searched form and found this option :

204711072_Screenshot_2020-05-26ProcessWirecoreupdates(2514).png.8efc8d20a4bdced7590a67fcd0893a4c.png

 

But in my Admin, I dont see any notification as per the 4th step above. The debug option is true and I am using ProcessWire 3.0.148 © 2020

Any idea why its not happening  ?

Link to comment
Share on other sites

Firstly, are you sure you need to modify the module for "style editing"? In case you haven't read already: https://processwire.com/docs/modules/guides/comments/

Secondly, if you do find you need to modify, I would consider upgrading to the very latest dev as there have been some major changes to the comments field and an important bug fix.

Consider those before worrying about why the approach you are taking isn't working yet.

  • Like 3
Link to comment
Share on other sites

If you want to make some style editing then it is overkill extending the main core php files, why not alter the CSS for the field comments, that is the approach i do for the FieldComments. 

Link to comment
Share on other sites

On 5/26/2020 at 8:25 PM, adrian said:

Firstly, are you sure you need to modify the module for "style editing"? In case you haven't read already: https://processwire.com/docs/modules/guides/comments/

Secondly, if you do find you need to modify, I would consider upgrading to the very latest dev as there have been some major changes to the comments field and an important bug fix.

Consider those before worrying about why the approach you are taking isn't working yet.

ok, I will try the  latest dev.. I am using the Master branch now

Link to comment
Share on other sites

and No, I dont want to ov

On 5/27/2020 at 5:11 PM, Ivan Gretsky said:

Hey @JeevanisM! You probably shouldn't override the core module, as all the good men stated above. But it's nice to know you can (and I actually did this before exactly with Comments field - hope it is easier to customize it now).

I dont want to edit the core module but I want to override the style used in the core module. In bootstrap we can override the default styles by writing our own params with same css class name used in BS and BS honor it if we call the custom css after the BS load.

Same as that, I want to override the style used in the comments module but I dont want to edit the core files..

Hence I copied the module to site/modules directory as mentioned here

But when I change the css file in the site/module - the css is again loading from the core module location. Any idea why this happens ? I will update to the latest dev branch and will try again

Link to comment
Share on other sites

On 5/26/2020 at 9:34 PM, flydev ?? said:

You might can explain what you are trying to achieve ? Maybe it's copying/editing the module is not required ?

yes I want to make changes in the site/modules files but my problems is the change I made in the css file in site/module is not in effect, still the css is loading from the core location..

Link to comment
Share on other sites

2 minutes ago, JeevanisM said:

yes I want to make changes in the site/modules files but my problems is the change I made in the css file in site/module is not in effect, still the css is loading from the core location..

Ok, but overriding CSS doesn't require creating a new copy of the module. Just inject the CSS you want into the PW admin - I use AdminOnSteroids for this, but there are other ways. 

Link to comment
Share on other sites

3 minutes ago, adrian said:

Ok, but overriding CSS doesn't require creating a new copy of the module. Just inject the CSS you want into the PW admin - I use AdminOnSteroids for this, but there are other ways. 

I am not sure about steroids.. but when I was using Concrete 5 CMS< they have this overriding method of modules, just copy the modules from the core DIR to the  theme DIR, then it will honor the priority ... Does PW have some thing like that ?

today its just css, what if I want to make changes in php files  in module ?

Link to comment
Share on other sites

13 minutes ago, JeevanisM said:

Does PW have some thing like that ?

Yes, exactly what you did, copying the module from Wire to Site/modules then refresh and select the new module when asked.

 

After a refresh :

Capture.thumb.PNG.10cb012b0d4f7385ba26618a830f1d08.PNG

 

After a click on "InputfieldCommentsAdmin" link :

Capture2.PNG.16d8c049757cc87c2113e49d558251b5.PNG

Same thing for "FieldtypeComments" and the CSS should now load correctly.

 

--------

Anyway, I suggest you to avoid this technique and to copy the CSS from the module and to paste it on your own principal main CSS file and tweak the CSS comments there.

Once that done, you won't have to worry about keeping the module up-to-date.

 

  • Like 1
Link to comment
Share on other sites

4 minutes ago, flydev ?? said:

Yes, exactly what you did, copying the module from Wire to Site/modules then refresh and select the new module when asked.

 

After a refresh :

Capture.thumb.PNG.10cb012b0d4f7385ba26618a830f1d08.PNG

 

After a click on "InputfieldCommentsAdmin" link :

Capture2.PNG.16d8c049757cc87c2113e49d558251b5.PNG

Same thing for "FieldtypeComments" and the CSS should now load correctly.

 

--------

Anyway, I suggest you to avoid this technique and to copy the CSS from the module and to paste it on your own principal main CSS file and tweak the CSS comments there.

Once that done, you won't have to worry about keeping the module up-to-date.

 

well thats my issue.  I am not seeing such  message notifications once I refresh  module page in admin ?  I double checked if I copied files, yes but not showing any message info ?  

Link to comment
Share on other sites

Just to clarify, are you do a Modules > Refresh? 

It also works fine for me.

But. again, please don't use this technique for CSS tweaks - it will result in lots of unnecessary pain when the core version of the module is updated.

  • Like 2
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...