Buddyboss Group Types Menu..nested/submenus? - php

I'm using Buddyboss and trying to arrange the group types in nested groups, eg. Continent -> Country -> Region. I am aware of hooks and actions/filters but not yet coded this type of thing, so am wondering how this would be achieved - I guess I need to find the correct hook and somehow amend the menu with an action/filter in functions.php. Many thanks.

Related

How to query listings in Sabai Directory plugin?

I'm looking for a way to query listings in PHP using Sabai Directory plugin. In my code, I extract the keywords from $_SERVER['REQUEST_URI'] and then intend to use them to find matching listings. Now, the problem is I need a way to assign those keywords to my listings in the first place. I tried 2 approaches:
Categories. It seems that Sabai does not support core WP categories (does it?), but has its own version. So if you create a Category, Sabai creates a page with a permalink for it. However, my categories are very trivial, they just have a label and a value with no content or no media; I don't want users to see category pages (e.g. /directory/categories/chocolate), it makes no sense.
Is there a way NOT to create a separate page for each category?
How do you query listings by multiple categories? Would this work: [sabai-directory category="chocolate,arizona,phoenix"], with category separated by comma?
Custom fields. I couldn't figure out categories by myself, so I created custom fields to simulate core WP categories. But the problem is I can't find a way to query listings by these custom fields. So if I need field_state field to be set to arizona or massachusetts, how do I limit my listings to either of those values?
Is there a way to specify custom fields in shortcodes?
Is there an API in Sabai that I can use to query listings directly? What would the post type be? What would the query look like? (There is no info on this in the docs)
On the same topic, once you query the listings, how do you display the contents for a single listing? I've tried [sabai-directory-listing id="?"] shortcode, but I don't understand where you get the id from: $post->id doesn't work.
Please let me know if you have any info

Exposed filters and views dependent filters

I am using drupal commerce. I created my products and made my exposed filters ordered by taxonomies that I had recently made. Now I want to link those filters in a specific hierarchy, each product had a specific types. For example :
printer has three types,scanner has four types .
If user selects printer in the product commerce type, the exposed filter for type shows the three types related to printer. I found a module called views dependent filter that may do this. Any suggestions to help me? Thank you
You may also want to look into https://www.drupal.org/project/facetapi , If you are going multi level deep it is very useful

Wordpress - Make category.php list posts from subcategories as well

I'm building a blog where three people will be writing, but they will have a separate section on the site. The structure is built upon categories and looks like this:
User one
Clothes
Fashion
Life
User two
Family
Life
User three
Family
Friends
Life
I've set all three users as writers and used the plugin Restrict Categories in order to lock their categories to the sub-categories the matching each top level category.
Now here comes the question, if I visit http://site.example/category/user-one/ I want to have a listing of all the posts, including the sub-categories since there will be no actual content in the top level category that you are browsing.
I've tried making this using filters bound to pre_get_posts but I still can't get it to work. Does anyone else here have any ideas?
I've also given some though into actually creating a multisite network for the purpose, but I then realized it will be hard to fetch posts from all the networks at once.
Thanks in advance, Jonathan
#Jonathan: Not sure if I am misinterpreting what you are hoping to achieve, but given that each author will already have their own 'author' page which lists all their posts (if your theme includes this or something you could create or customise), there may not really be a need for Users 1-3 to be their own category?
Going back to your question, for listing subcategories, perhaps https://wordpress.stackexchange.com/questions/13485/list-all-subcategories-from-category might be of some help.
As for listing posts, to keep things simple, I reckon you might be able to use e.g. get_posts (http://codex.wordpress.org/Template_Tags/get_posts) and build custom arguments, perhaps in a loop if you prefer to use one instead of slug/id specific category templates.
http://codex.wordpress.org/Category_Templates
If it's any help, Bainternet actually created a plugin that makes life a little easier to define category templates: http://wordpress.org/plugins/custom-category-template/

How to start on modifying the admin portion of Magento

I need to modify the Magento admin system to allow authenticated users to find products via manufacturer and category.
So, basically, either two select elements which an option for each manufacturer/category, or two autocomplete boxes.
What I need help with is how to get started. I can guess I edit the views to add the controls (which I've figured out how to do), but then where would I add the code to allow this functionality? Do I modify queries or modify how the model gets the products?

Magento - Multi-domain & Filters

We're looking to build in a filter to our Magento site with drop down choices for the first two options, a selection box for price plus a colour chooser.
Firstly how easy is it to fetch the info for the first two dropdowns from the database so the first box is populated with the first category then the second box populated with the choices for that particular category? (and then change if someone changes the first selection)
Secondly how easy is it to set up a separate filter for each site so it only fetches info for the corresponding store and doesn't show products from other stores?
The filter will only have to show the products when you press a 'find' button so I guess it's a case of building up the search query?
Thoughts and ideas on this would be great, only been working with Magento for a month so still not sure of it's full capabilities.
Thanks
For the second part Magento already shows only products relevant to a given store. When you set up the stores (in System > Store Management) you have the option of giving it a unique "root category". Creating root categories is easy, in Catalog > Manage Categories.
The first part requires some programming work. From your previous questions it looks like you have a good understanding of Javascript so AJAX is not a problem. I don't know how familiar you might be with PHP, listing products will require you create a new module, with it's own controller, that forms a collection from the selected category. Collections make their own queries so you don't need to write a lick of SQL, and they have functions for exporting as JSON or XML so you don't need to write that either. For an experienced programmer it would take almost no time at all.

Categories