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.4.2, getCategoryBlock(), slim plus, template
- This topic has 10 replies, 3 voices, and was last updated 10 years, 10 months ago by
Steven Zahm.
-
AuthorPosts
-
09/03/2015 at 7:28 pm #345500
Javier
ParticipantHello Steven!
How I can show the categories?
My php code
echo '<h3 class="" data-div-id="cn-detail-' , $uuid , '"' , ' style="border-bottom: ' , $atts['color'] , ' 1px solid ; color:#000000' , $atts['color'] , ';">' , $entry->getNameBlock( array( 'format' => $atts['name_format'] ) ) , $entry->getAddressBlock( array( 'format' => 'Localidad: %city% Provincia: %state%' , 'type' => $atts['address_types'] ) )Thanks!
09/03/2015 at 8:11 pm #345503Steven Zahm
Keymaster@ Javier
You can use the following function:
$entry->getCategoryBlock( array( 'separator' => ', ' ) );Hope that helps!
09/03/2015 at 8:39 pm #345507Javier
ParticipantThank you!
Can I put categories as permanent links?
09/03/2015 at 9:25 pm #345510Steven Zahm
Keymaster@ Javier
Sorry, no, I have not yet written the code to do that.
09/07/2015 at 4:58 pm #345882Javier
ParticipantHello Steven,
Already you solved the links into categories. Then the code (class.entry-output.php)
if ( empty( $atts['separator'] ) ) { $atts['list'] === 'unordered' ? $out .= '<ul class="cn_category_list">' : $out .= '- ';
foreach ( $categories as $category ) {
$out .= 'term_id . '"><li class="cn_category" id="cn_category_' . $category->term_id . '">' . $category->name . '';
}
$atts['list'] === 'unordered' ? $out .= '' : $out .= '
I managed to make me a checkbox to filter by state, but need to make a CheckboxGroup to select more than one state. Could you help, please?
My code:
array( 'name' => 'States Group', 'show_label' => TRUE, // Show field label 'desc' => 'field description', 'id' => 'address[::FIELD::][state]', 'type' => 'checkboxgroup', 'options' => array( 'Barcelona' => 'Barcelona', 'Madrid' => 'Madrid', 'Sevilla' => 'Sevilla', ),Because it doesn’t work?
Thank you very much!
09/08/2015 at 5:10 pm #346038Steven Zahm
Keymaster@ Javier
re: states checkbox not working
My best guess this is because the code that sanitizes and saves the state field is expecting a string, a checkbox group is sending an array. You need to edit the set addresses method in the cnEntry class to expect an array. When saving it, you’ll need to serialize the array into a string. I suggest using json_encode() to do this. You’ll also need to change the get address method to unserial the array. Beyond that, you might have to make numerous other changes throughout to the code to account for this type of change. What those would be, sorry, can’t really say off the top of my head.
HOpe that helps.
09/08/2015 at 10:51 pm #346047Javier
ParticipantThank you very much Steven!
10/06/2015 at 12:09 pm #349572georges langeard
ParticipantHi Steven,
I would like to display the categories in slim plus as well.
I dont find how to use your function:
$entry->getCategoryBlock( array( 'separator' => ', ' ) );Could you tell me a little bit more about implementing it? In which file?
slim-plus.php I guess?
Many thanks in advance,
Kind regards,
10/06/2015 at 6:10 pm #349602Steven Zahm
Keymaster@ georges
Just past the code where you want the categories to be displayed in the
card.phpfile for Slim Plus.Hope that helps!
10/07/2015 at 4:24 am #349629georges langeard
ParticipantIt worked perfectly, many thanks for your prompt response!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
