5.7 overriding src/social/servicelist/
Permalink
Hi all,
Should be a straight forward question for someone with more skills than myself... I am trying to change the icons used with the Social Icons block and have found they are contained within \concrete\src\Sharing\SocialNetwork\ServiceList.php.
I can edit this file and the change works however I am trying to follow the correct procedure by not changing the core and only creating overrides however when I move this to the Application directory, the change does not tale affect.
Is there anything special that needs to be done to this file to allow it become an override?
Should be a straight forward question for someone with more skills than myself... I am trying to change the icons used with the Social Icons block and have found they are contained within \concrete\src\Sharing\SocialNetwork\ServiceList.php.
I can edit this file and the change works however I am trying to follow the correct procedure by not changing the core and only creating overrides however when I move this to the Application directory, the change does not tale affect.
Is there anything special that needs to be done to this file to allow it become an override?
Nice trick, I like it... This will certainly serve my purpose however I hope someone out there might know how to achieve the override functionality the same way as blocks are overridden.
Thank you mesuva, your change will allow me to progress.
Thank you mesuva, your change will allow me to progress.
With overriding classes I'm pretty sure nearly everything can be overridden in 5.7, it's just all about the name spacing.
Perhaps have a look at this example I put up on github regarding the SecureimageController class:
https://github.com/concrete5/concrete5-5.7.0/issues/2088...
Take note of the way the namespace has been created and how the class extends the original file. I think it would be the same concept with the ServiceList class (I just haven't tested that specifically).
Perhaps have a look at this example I put up on github regarding the SecureimageController class:
https://github.com/concrete5/concrete5-5.7.0/issues/2088...
Take note of the way the namespace has been created and how the class extends the original file. I think it would be the same concept with the ServiceList class (I just haven't tested that specifically).
No luck I'm afraid... I attempted to change the namespace of the original file to
Thank you for taking the time to respond.
namespace Application\src\Sharing\SocialNetwork;
Thank you for taking the time to respond.
I've had a try myself, I didn't have any luck either.
I tried overriding the other classes in the same directory, plus the block controller, as I'm thinking some of the related classes are hardcoded namespaces. It seems to be a bit of a tangle, not something that could be cleanly overridden in this case.
I'm not sure if that's because I'm just missing something, or if this hasn't been considered for this kind of scenario.
I actually think this list of social links should be more of a config item, rather than in a class.
I tried overriding the other classes in the same directory, plus the block controller, as I'm thinking some of the related classes are hardcoded namespaces. It seems to be a bit of a tangle, not something that could be cleanly overridden in this case.
I'm not sure if that's because I'm just missing something, or if this hasn't been considered for this kind of scenario.
I actually think this list of social links should be more of a config item, rather than in a class.
It could get worse. Read
https://github.com/concrete5/concrete5-5.7.0/issues/2169...
https://github.com/concrete5/concrete5-5.7.0/issues/2169...
I dropped into /application/blocks/social_links/view.php the following code:
It's really just doing a quick find and replace on the HTML it outputs - arguably a bit hacky, but it was an easy way to achieve what we wanted to do.
So perhaps this is another way to achieve what you are wanting to do.