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: 8.5.32
- This topic has 14 replies, 2 voices, and was last updated 6 years, 2 months ago by
Jennifer.
-
AuthorPosts
-
03/19/2017 at 7:54 pm #416158
Jennifer
ParticipantHi Steve,
This question is re: the custom code to only display children of an assigned category on cards. There is now a need to work with two different categories now, and I haven’t been able to figure it out. Here’s the current code:
if ( 'individual' !== $entry->getEntryType() ) { $entry->getCategoryBlock( array( 'separator' => ', ', 'before' => '', 'after' => '', 'child_of' => 24 ) ); }
I’m trying to display the children of category 21 as well, but nothing happens when I try 24,21 without single quotes or with them. Any suggestions would be greatly appreciated, as I’d prefer to not combine these categories as far as organization goes. Thanks very much!!
Jennifer
03/20/2017 at 9:25 am #416197Steven Zahm
Keymaster@ Jennifer
The
child_of
option will only work with a single category ID. You only option is to add the line twice, like this:Like this:
if ( 'individual' !== $entry->getEntryType() ) { $entry->getCategoryBlock( array( 'separator' => ', ', 'before' => '', 'after' => '', 'child_of' => 24 ) ); } if ( 'individual' !== $entry->getEntryType() ) { $entry->getCategoryBlock( array( 'separator' => ', ', 'before' => '', 'after' => '', 'child_of' => 21 ) ); }
Hope this helps!
03/20/2017 at 11:20 am #416252Jennifer
ParticipantThanks for the quick response, Steve — that resolves the issue. I really appreciate it!
Jennifer
03/30/2017 at 11:53 am #418144Jennifer
ParticipantHi Steve,
I’ve added onto my original thread because the issue I’m seeing is somewhat related — it’s probably a small change to fix this.For the original customized shell, each entry’s categories are separated by a comma and there is not a line break after each category (this is ideal): http://longworthcreative.com/edirectory-shell/members-by-company/
For some reason, I am not able to get the categories to display this way on the populated directory. I’ve attached a screenshot. Do you know what I’m doing wrong? The child_of code above displays the comma separator, and that’s how the code looks on the site.
On a different note, I am putting together a list of items I’d love to get a quote re: customization for. I will be in touch about that via email soon.
Thanks in advance, as always!!
JenniferAttachments:
You must be logged in to view attached files.03/30/2017 at 1:26 pm #418187Steven Zahm
Keymaster@ Jennifer
They both look the same to me … other than different category names being displayed. Is that the issue? If it is, you’ll need to change the child_if category ID to match the correct category on the published site. The IDs will not, likely, be the same between the two sites.
03/30/2017 at 1:53 pm #418194Jennifer
ParticipantDifferent category names are fine, it’s just that each category has its own separate line. Better ex: http://wtcabc.performancepublishing.net/member/name/belz-construction-services-llc/
Even though the category listing is more clear this way, the end user wants everything listed with a comma in-between entries like the customized shell did, with no line breaks. Please let me know if I can further clarify. Thank you very much!
03/30/2017 at 2:18 pm #418199Steven Zahm
Keymaster@ Jennifer
I can view the link, it requires a login.
But I guess I still do not understand. The demo site and the screenshot still look the same to me. Each category is on its own line, its just that the category names are so long that they wrap into two lines. I do no see any commas…
or is that the point? They want it on the “same” line (even though it’ll line wrap) separated by commas. Is that correct? If that is, there’s no way to do that easily.
The code above would put commas in between categories if there were more than one of the child_of categories assigned to the entry within one of the child_of categories.
Judging by the screenshot, each instance of the code, only one child_of category is assigned to each of the child_of categories. There’s no easy way to “combine” the result of both the child_of category results separated with commas. Boy… I hope that makes sense!
03/30/2017 at 8:16 pm #418242Jennifer
ParticipantHi Steve, I reread your reply a few times but just want to make sure we’re on the same page (only because this feature worked great when it was on the test directory).
You are correct about the desired feature being to wrap the categories so that each one is not on a separate line, and also has a comma in between.
I’ve included a screenshot that shows the difference between the original test directory and this one, and I can definitely get those login credentials resent (I think I shared them before but will dig them up if needed!!).
Does the screenshot change anything? Thanks!! And apologies for not fully grasping your reply!
Jennifer
Attachments:
You must be logged in to view attached files.03/30/2017 at 8:21 pm #418244Jennifer
ParticipantI want to add that while this thread was originally discussing if children could be displayed from more than one parent category, there is not one entry that will ever have both types of parent categories on the same tile… if that helps matters.
03/31/2017 at 10:12 am #418374Steven Zahm
Keymaster@ Jennifer
Ok, I think we’re on the same page now. The published directory requires a login, can you please give me one? Screenshots help, being able to see the HTML code of the page is even more helpful (to me).
If possible could you put up the code in pastebin or in a shared dropbox folder or even email it to me. I really have too se what was done in order to give the solution. Thanks!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.