Good-Bids / goodbids

0 stars 0 forks source link

Determine approach for Partners page #129

Closed clatwell closed 9 months ago

clatwell commented 10 months ago

Requirement

Approach Questions

nathan-schmidt-viget commented 10 months ago

@clatwell @bd-viget Did some research on this and I am not finding an option/filter to have a custom post type only on the network level. Once you create a post type it is for all sites. But I think there are two solutions.

Unregister Partners on Child Theme

We would register the custom partners post type in our plugin and in our child Goodbids theme unregister the post type. The downside to this is that we have to unregister it every site and I am not sure if that would cause any problems with the database.

Hide Partners on child sites

This would be very straightforward. We would register the custom partners but would remove the admin navigation to get to the post type on all sites but the network(main) site. This would keep the DBs for all the site the same, but nonprofit admin users would not be able to navigate to the partners section. Even if they did somehow find the URL in the admin there would not be any content. If we really wanted to we could take it one step further and only allow some users to be able to access the partners section on the admin.

I think only showing the admin menu on the network level makes the most sense to me. Maybe we can chat about it in our next standup.

clatwell commented 10 months ago

+1 to discussing in standup. "Unregister" feels like the more foolproof approach from a Nonprofit Site Admin perspective than "Hide", but I don't know enough on the WP side to make a concrete recommendation.

nathan-schmidt-viget commented 10 months ago

I did a quick test of unregister Partners on Child Theme and it seems to work just fine. The other idea I just tried (not sure why I did not think about this before) is adding a if ( is_main_site() ) to the call that registers Partners. That seems to work and it is only registered on the main site which saves the call to unregister on child sites.

clatwell commented 10 months ago

@nathan-schmidt-viget Ok, fantastic! I'll spin up some quick tickets for the Partners CPT, index, and detail page when I'm out of meetings at ~2pm.

clatwell commented 10 months ago

@nathan-schmidt-viget - I'm going to move this ticket over to "In Review" for now while we wait for final requirements data and display requirements from GB. I'll add those details to follow-up tickets and we can work from those to get this over the finish line.

nathan-schmidt-viget commented 9 months ago

@clatwell the main partners post type has been merged with main. We can now add on to that with custom fields and templates.

shascher commented 9 months ago

Created a Partner as a test: https://goodbids-develop.go-vip.net/partner/viget/