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 5 replies, 2 voices, and was last updated 8 years, 4 months ago by
Steven Zahm.
-
AuthorPosts
-
04/22/2015 at 6:15 pm #332121
Tim Emineth
ParticipantSorry I didn’t really know how to title this Please change it to help others. Here is my website: http://ashiww.personalseo.com/snohomish/ Two questions (they relate)
1. In searching the forum I found that you can edit the code in card.php: `echo ‘</li>
</ol><h3 class=”cn-accordion-item” data-div-id=”cn-detail-‘ , $uuid , ‘”‘ , ‘ style=”border-bottom: ‘ , $atts[‘color’] , ‘ 1px solid; color:’ , $atts[‘color’] , ‘;”><span style=”background-color: ‘ , $atts[‘color’] , ‘”></span>’ , $entry->getNameBlock( array( ‘format’ => $atts[‘name_format’]) ). ” . $entry->getPhoneNumberBlock(). ” . $entry->getContactNameBlock(),'</h3>
‘;<code>Which I have and I have edited the css to adjust the view by adding the following:</code>}
<h1>cn-list span.tel {</h1>
display: initial !important;
}<h1>cn-slim-plus span.tel {</h1>
margin: 10px !important;
}<h1>cn-list .vcard-block, #cn-list .cn-last-updated {</h1>
display: none !important;
}<h1>cn-list span.phone-number-block {</h1>
margin: -20px 44px 5px 284px !important
}` (if you have a better way to do what I am trying to do through css let me know) the Contact section is not in a class like the phone section is: The css in the phone section is in a phone-number-block The contact us section is not in it’s own block so I can’t move it (am I missing something)
2. Also is there a way just to show one phone number instead of all of them?As you can see I am trying to get the company name / contact/ and phone on 1 line
-
This topic was modified 8 years, 5 months ago by
Tim Emineth.
04/23/2015 at 2:04 pm #332217Steven Zahm
Keymaster@ Tim
First, tip, when you paste code, highlight it and click the code button
{}
. That will make sure it does not get mangled.Try this CSS instead:
cn-list span.fn, #cn-list span.org { display: inline-block !important; width: 25% !important; } #cn-list span.phone-number-block { display: inline-block !important; margin: 0 !important; width: 45% !important; }
You can limit the phone numbers in more than one way, depends on what you need…
You can limit by type:
$entry->getPhoneNumberBlock( array( 'type' => 'work,cell' ) )
$entry->getPhoneNumberBlock( array( 'type' => 'work' ) )
This would not limit the number per type though… say you had two work numbers and two cell numbers for an entry, the result would be four numbers.
OR
You can limit by a hard limit:
$entry->getPhoneNumberBlock( array( 'limit' => 1 ) )
This would “hard” limit to only one number but there would be little control. It would simply be the first number pulled from the db for the entry.
You could limit one number of a particular type like this:
$entry->getPhoneNumberBlock( array( 'type' => 'work', 'limit' => 1 ) )
Downside here is if you had two work numbers for entry, the result could be either one.
OR
You can show only the “Preferred” number:
$entry->getPhoneNumberBlock( array( 'preferred' => true ) )
The downside here, is if you did not set a “Preferred” phone number when adding the entries, you’ll have to go back, edit each one, setting the preferred number.
As for the contact block, right, I should have one and I just did. This change will be part of the 8.2.5 release. But since you are editing the template, it is simple enough to add your own block, like so:
'<span class="my-contact-block">' . $entry->getContactNameBlock() . '</span>'
Hope that helps!
04/29/2015 at 5:46 pm #332933Tim Emineth
ParticipantThis was all working great then connections had an update now I have the following The contact name block repeating: http://ashiww.personalseo.com/snohomish/ I have tried removed and replacing the code above (and even editing) and it duplicates the contact name block
echo ‘<h3 class=”cn-accordion-item” data-div-id=”cn-detail-‘ , $uuid , ‘”‘ , ‘ style=”border-bottom: ‘ , $atts[‘color’] , ‘ 1px solid; color:’ , $atts[‘color’] , ‘;”>‘ , $entry->getNameBlock( array( ‘format’ => $atts[‘name_format’])) .”.$entry->getContactNameBlock().”.$entry->getPhoneNumberBlock( array( ‘limit’=> 1 ) ),'</h3>
‘;
This was my working code before the update:
echo '<h3 class="cn-accordion-item" data-div-id="cn-detail-' , $uuid , '"' , ' style="border-bottom: ' , $atts['color'] , ' 1px solid; color:' , $atts['color'] , ';">' , $entry->getNameBlock( array( 'format' => $atts['name_format'])) .''.'' . $entry->getContactNameBlock() .' '.$entry->getPhoneNumberBlock( array( 'limit'=> 1 ) ),'</h3>';
-
This reply was modified 8 years, 4 months ago by
Tim Emineth.
-
This reply was modified 8 years, 2 months ago by
Steven Zahm.
04/29/2015 at 6:49 pm #332940Steven Zahm
Keymaster@ Tim
Well, that does not make any sense. The only change was to put a span around the entire contact name, contact-block so it could be better targeted with css. Also the duplicates are before and after a phone number block. If duplicates were being output, then I would expect them to be one after the other, but they are not. The only thing that make sense is the
$entry->getContactNameBlock()
is in the code twice; once before and one after the phone number block. Could you double check the code?04/30/2015 at 1:27 pm #333057Tim Emineth
ParticipantOK Here is what I have done (still can’t figure it out)
I removed all of the code that I had added to card.php and started over from scratch.
I then tried to add in the GetContactNameblock like before and it duplicates.
I then removed everything but the GetContactNameBlock and it still duplicates.
Here is the code now:
echo '<h3 class="cn-accordion-item" data-div-id="cn-detail-' , $uuid , '"' , ' style="border-bottom: ' , $atts['color'] , ' 1px solid; color:' , $atts['color'] , ';">' , $entry->getContactNameBlock() ,'</h3>';
As you can see above the only $entry is the getContactNameBlock and it is still duplicating.
04/30/2015 at 2:50 pm #333102Steven Zahm
Keymaster@ Tim
Ok, after some testing, I was able to duplicate this and fix it. There was another tweak designed to simplify whether the HTML should echo or be returned. This defaults to echo. Since you are echo’ing this line, the return HTML is being echo’ed by the echo at the beginning and the echo from within the contact block code. In my “normal” intended usage, this would never occur which is why I did not catch it when I tested the tweak.
To fix this, I moved this logic to a little helper function which only handles this. I updated the contact block to use this helper function. Now I need to update all the other areas in the code where I made this same tweak to use this new helper function to avoid the same issue with them.
This fix, will be in 8.2.6 which I plan on releasing this weekend. This releases changelog is almost as long the one for 8.2.5. A bunch of very minor issues fixed with a lot of code and doc clean up.
Apologies for the trouble!
-
This topic was modified 8 years, 5 months ago by
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.