Forums › Forums › Search & Filter Pro › migrating to pro version
- This topic has 13 replies, 2 voices, and was last updated 10 years, 5 months ago by Ross.
-
Anonymous(Private) June 24, 2014 at 12:34 pm #1841
Hi,
I’ve spent the past week working on making changes to an existing wordpress site so that it does what our designers want.
I’m was new to wordpress, but I am a developer and have html/css/js skills and can understand php to an acceptable level. I guess I’m picking up wordpress, but approached it in (perhaps) the wrong way – ie I just dove in and made changes without completely understanding the architecture of a wordpress site.
The site I’m working on is just a web site, and not a blog as such, and is used to showcase a set of projects.
The designers wanted the ‘all’ page to show all the projects when the page is loaded and update the projects shown as terms are entered/selected in the searchandfilter. This is quite similar to the AJAX part of the pro version, hence us purchasing it (along with the prospect of support).
However, I see that the pro version is quite different to the free version – the version number of the pro version makes me think it’s older, though it’s probably just different. Anyway, I have a set of changes in the free version that I now need to port over into the pro version and everything is quite different.
Is there any guide to how the parts of the free version relate to the parts of the pro version?
Max.
Ross Moderator(Private) June 24, 2014 at 12:56 pm #1846Hey Max
Yeah there is always a danger when modifying plugins directly, because they don’t offer support like in themes (where you can have child themes and modify these as you wish) – so any update, you risk losing all changes you’ve made.
The pro version codebase is considerably different to the free, but there are remnants in there..
Can you describe to me what it is you made the free version do and maybe I can point you in the right direction?
Thanks
Anonymous(Private) June 24, 2014 at 1:32 pm #1852NB, I have the whole site under git, so I can always revert mistakes – my own and if someone accidentally updates the plugin/etc. My safety-net ๐
Ok, so my changes…let me check git diff with the first version to remind me…
1) I added a new widget called ‘multiselect2’, so I have a new file called ‘multiselect2.js’ that implements the widget’s functionality (mostly click handlers).
2) in of-taxonomy-walker.php, I added multiselect2 by duplicating multiselect and modifying; so I have another else in function start_el() that produces the html I want for each option – basically just a label followed by a checkbox (with appropriate classes/etc)
3) in search-filter.php I:
3.1) added an action for my js script,
3.2) in get_search_filter_form() I added a ‘multiSelect2Submit’ class to the submit element (when it’s a multiSelect2 element)
3.3) in build_taxonomy_element() I added some complexity to the h4 element when it’s a multiSelect2
3.4) also added another else for multiselect2 to call generate_wp_multiselect2()
3.5) added generate_wp_multiselect2() to produce different html (not select, but a simple div wrapper)
4) style.css has a bunch more styles to make multiselect2 look how I want (including a couple of animations).Thanks about it, really.
What do you think?
Max.
Ross Moderator(Private) June 24, 2014 at 2:55 pm #1858Hey Max
Yeah looks like you will have a bit of work to do in that case.. I’m going to go through and point you in the right direction such as which files I think you should be looking in to modify – will be in touch a bit later this afternoon once I’ve had a chance to go through.
Thanks
Ross Moderator(Private) June 25, 2014 at 7:42 pm #1898Hey Max sorry had to get back on to another thread, trying to find the equivalents but there’s not much, I’ll just be able to tell you which files you’ll likely need to look in to make your changes.
Be back in touch shortly.
Thanks
Ross Moderator(Private) June 26, 2014 at 12:37 am #1900Hey Max
So here’s some of my best guesses as to where you need to look, hope it will help (ps my numbers don’t match yours):
1) So the taxonomy walker still exists, and just has some extra functionality in there but should be straight forward enough if you edited the last one, its now located in:
search-filter-pro\public\includes\class-search-filter-taxonomy-walker.php
2) A lot of the display functionality that existed in the free plugin is now located in:
search-filter-pro\public\includes\class-search-filter-display-shortcode.php
3) There is also now a class that sits in between the shortcode functionality and between displaying the fields (like taxonomy walker)
search-filter-pro\public\includes\class-search-filter-generate-input.php
4) If you use author fields, there is now an author walker in the same directory
And thats it really, these are the new classes involved with displaying the search form, the functionality found in the free plugin has been spread across these with more functionality added of course.
There are now classes added to each list item in the search form (each field was wrapped in a list item) which is reflective of the field it contains, which should make styling fields individually a lot easier – eg, category field is wrapped in the class
.sf-field-category
.And there is also now an implementation of Chosen (http://harvesthq.github.io/chosen/) for select fields and multi select which may be of interest to you ๐
Hope this helps you, but as a warning, if you have to make plugin modifications then you can’t really upgrade easily and therefore you won’t get access to new functionality and bug fixes – but I guess you know that already!
Thanks
Anonymous(Private) June 26, 2014 at 2:46 pm #1919Hi,
Thanks for the guidance.
Yes, I realise the problems with modifying the code. I suppose it’s possible I could submit the code to you to have you include it, since it’s GPL ๐ – though refusal is a realistic reaction, so I could quite easily end up with a maintenance problem. However, they do want these changes, so I don’t have much choice.
Anyway, one thing you could help me with is how best to try out the changes. It’s such a big change that I will almost certainly not get it right first time. Ideally, I’d like to replicate the site onto my own local machine so I can test it out first. So far, I’ve just been updating the site live…it’s only internal and at the beginning of the project, so it’s no big deal if things stop working, but it’s starting to be so that I can’t do that any more.
I’m using Ubuntu, so I guess it’s fairly straight forward? Do I just set everything up per the wordpress.org instructions? I already copied the files over, but that doesn’t work and that’s probably because I don’t have any database set up. Any guidance here?
Max.
Ross Moderator(Private) June 26, 2014 at 7:50 pm #1928Hey Max
By all means you can submit the code to me however if additional features are not integrated in to the admin section for other users to enable/disable then I can’t easily include it in updates, as well as this I’ll obviously have to give the modifications and good review and testing first – but by all means send over and don’t be shy ๐
RE the testing… basically, you would test the plugin in a testing environment (ie locally) – there is nothing specific about this plugin that would affect how it performs online or in a local environment so basically you’ll have to set up wordpress locally in order to test – which means you’ll have to have a database setup in your environment – personally I use https://www.apachefriends.org/index.html as a development server but all that is a bit out of scope for support of the plugin – there are loads of guides about this:
Once you made modifications locally upload the plugin from local to online – and just make sure you never update it!
Anonymous(Private) July 1, 2014 at 6:48 pm #2025Hi,
I’m trying to move forward with this. I’ve basically been trying your pro plugin without invoking any of my changes, just to see how close I can get with it how it is.
So, I’ve added a search form, with ‘Search’, a couple of my own Taxonomies, and a ‘Submit Button’.
They appear on the all page, and the menus have appropriate content, so that’s good.
Now I’m attempting to get the Ajax working. I checked ‘Load results using Ajax?’ and ‘Auto submit form?’ – I’m not entirely sure what the difference is between those options, but I ignored that question for now. I then looked at the container for the projects’ portfolio. Looking at the source of the all page, I see a structure like the following :
<div class="et_pb_portfolio_items clearfix columns-4" data-columns="" style="opacity: 1;"> <div id="post-706" class="post-706 project type-project status-publish has-post-thumbnail hentry et_pb_portfolio_item " style="height: 221.8125px; width: 25%;">... </div> <div id="post-704" class="post-704 project type-project status-publish has-post-thumbnail hentry et_pb_portfolio_item " style="height: 221.8125px; width: 25%;">... </div> <div id="post-702" class="post-702 project type-project status-publish has-post-thumbnail hentry et_pb_portfolio_item " style="height: 221.8125px; width: 25%;">... </div> ... </div>
So, I entered ‘.et_pb_portfolio_items’.
Now, when I load the all page, the whole portfolio goes a faded colour for a second and then comes back. Unfortunately, I don’t see anything different than before.
Can you tell me what I’m doing wrong?
Thanks,
Max.
-
AuthorPosts