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.
- This topic has 16 replies, 2 voices, and was last updated 6 years, 6 months ago by
Steven Zahm.
-
AuthorPosts
-
07/07/2016 at 12:21 pm #381875
wemmons53
ParticipantCurrently, when viewing a Family record, the relationship links are displayed, which I love. The link goes to the Individual record view.
I have 3 questions/suggestions.
1.
Would it be possible to add a link to Show Detail/Hide Detail (like used on the Manage list entries – see screenshot) on the relations links that display on a family entry page? See my mockup screen shot.Then when you click it, the individual info would drop down/up (like in the manage view).
This way you can see all the family and related individual data on the same page.
2.
Would it be possible display the individual record in a popup or to a new window as an option instead of just going to the record?I would like to see the code to play with this idea. Where is code that displays the individual record?
07/07/2016 at 2:26 pm #381891Steven Zahm
Keymaster@ William
re: Would it be possible to add a link to Show Detail/Hide Detail (like used on the Manage list entries – see screenshot) on the relations links that display on a family entry page
Yes, that indeed is possible. It will have to be custom coded as they is no switch or setting that can changed to make this change. You would have to modify the template that you are using, I suggest a template override file as discussed in this tutorial.
re: Would it be possible display the individual record in a popup or to a new window as an option instead of just going to the record?
Yes, this too is possible. But this too would have to be custom coded.
re; I would like to see the code to play with this idea. Where is code that displays the individual record?
I’m not exact show which code you are asking to see… I’m going to guess the code that displays the family names and links on the template. This code can be found in the
class.entry-output.php
file found in this folder:
../wp-content/plugins/connections/includes/entry/
The function name is,
getFamilyMemberBlock()
.You will see this called in the template in the
card-single.php
file in this folder:../wp-content/plugins/connections-tile-plus/
Assuming you are going to change the Tile Plus template.
Hope that helps!
07/07/2016 at 5:16 pm #381907wemmons53
ParticipantThe browser shows //hcfcog.org/church-directory/name/emmons-william-karen/ when I’m displaying the family record. This has the links I would like to try to modify. It is page displayed when I click the View option for my family record from the //hcfcog.org/wp-admin/admin.php?page=connections_manage page. This is where I would like to change it to start with.
Otherwise, I assume to modify the family tile, it would be the card-single.php you show above. I will also look at this also. Thanks Steven
-
This reply was modified 6 years, 6 months ago by
wemmons53.
07/13/2016 at 1:25 pm #382680wemmons53
ParticipantSteven,
I see how the above works to modify the card.php and card-single.php files, but not just a single function. If found the functions in class.entry-output.php, but would rather not copy entire file over.
Is there an easy way to override just the getFamilyMemberBlock() function?
I would just copy that function and make my changes to it. Not the original.Since I use the My Custom Functions plugin (like Code Snippets plugin), could I add it there to override the original?
I had put the code you gave me to override the the default entry type there. See forum post “Add Entry Default Settings”
07/13/2016 at 3:14 pm #382707Steven Zahm
Keymaster@ William
You could copy the code within the getFamilyMemberBlock() method to your own custom function and pass in the $entry var from the template when you call it. Something like this:
function custom_family_function( $atts, $entry ) { /copied code/ }
In the template files use it like this:
custom_family_function( $atts, $entry )
Now, within the copied code you would have to change this:
if ( $relations = $this->getFamilyMembers() ) {
to this:
if ( $relations = $entry->getFamilyMembers() ) {
And this:
return $this->echoOrReturn( $atts['return'], $html );
to this:
echo $html;
I think that’s it.
07/26/2016 at 7:42 pm #384288wemmons53
ParticipantIn tile-plus.php, I added a short code called “show_family_detail” so I can turn on/off my info in the html.
I added my function “getFamilyMemberDetailBlock” to class.entry-output.php, as instructed above.
I added following to the tile card.php after the series of “if” statements, for the calls to show_phonenumbers, show_emails, etc.
<div style="display: inline-block;"> <?php if ( $atts['show_family_detail'] ) $entry->getFamilyMemberDetailBlock( $atts, $entry ); /*** ADDED BY WHE ***/ ?> </div>
In my function, I added code after the “foreach ( $relations as $relationData )” loop the was enclosed in ”
<
div>” I put some examples to show what I want. See the image of a tile below. Div is boxed is red.
I would like to be able to access the data for each of the relative entries using a series of if stmts like used in card.php, like one following.
if ( $atts['show_phonumbers'] ) $html = $html . $entry->getPhoneNumberBlock( array( 'format' => $atts['phone_format'] , 'type' => $atts['phone_types'] ) );
How would I need to change this to access the data particular to each family member?
I can’t figure that out at this point.
Could you help? Thanks Steve, Bill
-
This reply was modified 6 years, 6 months ago by
wemmons53.
-
This reply was modified 6 years, 6 months ago by
wemmons53.
-
This reply was modified 6 years, 3 months ago by
Steven Zahm.
07/27/2016 at 1:03 pm #384335Steven Zahm
Keymaster@ William
Within the copied code from the original
getFamilyMemberBlock()
function you’ll find this line;$relation = new cnOutput();
. Now, within your custom function you be able to use like this:if ( $atts['show_phonumbers'] ) $html = $html . $relation->getPhoneNumberBlock( array( 'format' => $atts['phone_format'] , 'type' => $atts['phone_types'] ) );
You would add this to your custom family function, not in the template. Also, take note that it is
$relation->getPhoneNumberBlock()
and not$entry->getPhoneNumberBlock()
.Hope that helps!
ps.
re: I added my function “getFamilyMemberDetailBlock” to class.entry-output.php, as instructed above.
No, you should not edit the
class.entry-output.php
file. Any changes you make there will be lost during an update. Put your custom function elsewhere. For example in a code snippet.07/28/2016 at 7:41 pm #384640wemmons53
ParticipantSeems like the shortcodes used in $atts[‘show_phonumbers’] is not initialized.
Do we have to add filter to add these shortcodes. All the if stmts using these codes fail in my custom function.
07/29/2016 at 8:38 am #384720Steven Zahm
Keymaster@ William
If you custom function you did add
atts
variable as a parameter and pass it from within the template to you custom function, correct? Like this:custom_family_function( $atts, $entry )
Also, they are not shortcode codes, they are array key indexes. The
$atts
variable is an associative array.How about posting you code up on pastbin or creating a private gist to share?
07/29/2016 at 8:16 pm #384814wemmons53
ParticipantHere is copy of my function on Pastebin.com
Function: getFamilyMemberDetailsBlock
This is a copy of the getFamilyMemberBlock function with the few modes you told me to make. It does not work on the call. I added simple echo and return to make sure it was being called correctly and that shows fine. When I commented out my test line, it fails somewhere.
I don’t know how to debug it. I’m using Firefox browser.
The call from card.php works fine. I have an template override file, using method you point me to early on. That works great. It’s just getting the internals of the functions to work that I’m have a problem with.
Thanks Steve, appreciate your help.
Bill
-
This reply was modified 6 years, 6 months ago by
-
AuthorPosts
You must be logged in to reply to this topic.