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.1.7, enable_note, getExcerpt, getNotes, shortcode
- This topic has 5 replies, 2 voices, and was last updated 11 years, 6 months ago by
Steven Zahm.
-
AuthorPosts
-
02/02/2015 at 7:04 am #317921
DOMINIC
ParticipantHi, Is there any way to replace the except field with the notes field?
My situation is that on one page I want to show an organization’s bio (excerpt) social media, address website ect…) and on another page their “role” (notes field)
If this is not possible I can modify the profile template. but how do i make the images smaller using profile? similar to the size used in excerpt?
thanks
dom
02/03/2015 at 9:39 am #318001Steven Zahm
Keymaster@ dominic
This can be done but you’ll have to modify the template. In the
card.phpfile you’ll find this line:echo strip_shortcodes( $entry->getExcerpt() );Change it to this:
echo strip_shortcodes( $entry->getExcerpt( array(), $entry->getNotes() ) );That make the excerpt from the notes fields.
Then you need to enable the notes field via a shortcode option enabled by Excerpt Plus like so:
[connections enable_note='true']Hope that helps!
02/03/2015 at 10:12 am #318011DOMINIC
ParticipantPerfect, but I am using excerpt already in another part of the site (with the excerpt field) this mod would wreck that page. in a past post you explained how to duplicate a template http://connections-pro.com/support/topic/making-a-custom-version-of-plugin/
Name change the name of excerpt.php to something else unique. (not important that this step is done or not.)
Open the excerpt.php file.
Change all instances of CN_Excerpt to something very unique.I assume this would be the only way to have two different card.php files. is there anyway to minimize the duplication of code that is loaded? (or am i worrying too much)?
thanks
dom
02/03/2015 at 12:35 pm #318027Steven Zahm
Keymaster@ dominic
You could dupe the card. Another option which may or may not be more difficult, depending on your PHP skills, is to add a new shortcode option to Except Plus to let you define whether it should use the bio or note for the excerpt.
You would have to register the new option in the
excerpt-plus.phpfile adding$permittedAtts['excerpt_text'] = 'bio';in theinitShortcodeAttsfunction. Then in thecard.phpfile you could create an if statement something like:if ( $atts['excerpt_text'] == 'bio' ) { echo strip_shortcodes( $entry->getExcerpt() ); } else { echo strip_shortcodes( $entry->getExcerpt( array(), $entry->getNotes() ) ); }Then on the page where you want to use the notes you could use the shortcode:
[connections excerpt_text='notes']Now the template should use the notes instead. The
notesin the shortcode could be any word you want because it does not matter since the if statement is only looking forbioso if anything other thanbiois used withexcerpt_textthe notes will be used for the excerpt.Be forewarned, make this change will not be update safe since there is not a way to “override” the
excerpt-plus-phpfile like the other files.Hope this makes sense.
02/04/2015 at 2:55 am #318126DOMINIC
Participantmade perfect sense. and got it working, modified your code a little removed the “entry->getExcerpt( array(),” in the else field so that only the notes appeared.
I also placed a second modified version of the if statement farther down as to replace the echo biobloc line 96 else it showed the excerpt on expansion.
all this in a future proofed template folder so only one line of code to change on update.
Thanks for the great support!
dom
02/04/2015 at 8:37 am #318187Steven Zahm
Keymaster@ dominic
Great to hear and thanks!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
