Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 0.7.9.3, category, limit, parent, widget pack
- This topic has 5 replies, 3 voices, and was last updated 12 years, 1 month ago by
Beezzy Vesa.
-
AuthorPosts
-
01/09/2014 at 4:15 pm #276790
Julie
ParticipantHello,
I’m using Connections as a business address book for our community band. Some address are for internal use, and some we want to be available to the public.
I’m working on a template page where, in my perfect world, would have a list of a few categories in the widget, (styled to match my site,) with category descriptions, and when clicked re-populate the post section of that page with the contacts.
I’m trying to wrap my brain around how I am going to approach this, I realize I can use the private/public options but the widget has no filters or options and shows categories with 0 in it. Is there a snippet of code I can use in my template that shows categories but allows me to customize it?
I’m very good with CSS but don’t bother with it until I get the output I want. Here is my testing page
http://jhcband.org/test-page
The post side of the page is filtered by one category at the moment, I want the widget (right) to show only 5 or six of those categories and I will style them to look like the log in and contact blocks above it with the category description in the block.Any help or suggestions would be greatly appropriated.
Thank You,
Julie01/10/2014 at 10:14 am #276845Julie
ParticipantI figured it out!
<?PHP { global $connections; echo $before_widget; $atts = array( 'type' => 'link', 'show_count' => TRUE, 'show_empty' => FALSE, ); $connections->template->category( $atts ); echo $after_widget; } ?>Sometimes I can’t see the forest for the trees.
-
This reply was modified 12 years, 9 months ago by
Julie. Reason: typos
01/10/2014 at 11:29 am #276850Julie
ParticipantI deleted
global $connections; echo $before_widget; echo $after_widget;from my page and it seems to work.
I’m looking for the correct thing to add to the array, or my code to filter only public entries so that only public entries are counted, and any categories with only private entries are hidden.
OR
Add to my array which category IDs to display.
I’m weeding through code on the pages to learn/see what needs to be coded, but I’m out of time today. Any help would be appreciated.
Thank You,
Julie01/13/2014 at 1:19 pm #276994Steven Zahm
Keymaster@ Julie
Apologies for the delay … I’ve had a higher workload than normal…
You can add
parent_idto the array. It’ll accept the category IDs of root parent categories to include in the list. The code can be found here:
https://github.com/shazahm1/Connections/blob/0.7.9.3/includes/template/class.template-parts.php#L803This will only work for root parent categories though. What I mean by root parent is a category that is not a child of another category. Hope that makes sense!
As for counts, right now, those counts include every entry regardless if it is unlisted/private or in the moderation queue. So it’s best to simply hide the count if showing them is going to cause confusion for your users.
Hope that helps!
01/14/2014 at 10:49 am #277063Julie
ParticipantThank you!!
09/14/2014 at 9:03 pm #304028Beezzy Vesa
GuestThis reply has been marked as private. -
This reply was modified 12 years, 9 months ago by
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
