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 15 replies, 2 voices, and was last updated 7 years, 6 months ago by
Steven Zahm.
-
AuthorPosts
-
02/05/2019 at 12:57 pm #483638
CRAIG HALLER
ParticipantIs there a way, knowing only the Organization, to get all the data in that particular entry? [connections organization="xx"] gives it to me but as a complete web page. The meta_query and content shortcodes don’t seem to be documented (please point to them if they are and if they are my solution). Or can you give an example database query for the information.
02/05/2019 at 1:06 pm #483639Steven Zahm
Keymaster@ Craig
Not sure I understand the question… an organization could be one or many as they are not unique. That really depends on what is in your directory. For example, you could have 11 McDonalds in your directory as organizations with 101 Individual who have McDonalds in their organization field.
To get a specific entry, you want to get it by its
id. To do this, you can use the id shortcode option.Not sure this helps, but I hope it does.
02/05/2019 at 1:12 pm #483640CRAIG HALLER
ParticipantMy organizations are all unique, over 1,000 schools in my state. I am loading the database from an excel file that has all the information for basic entries (organization name, phone, etc.). There are places on the site where I want to display information about the school and all I have is the organization name and I need to do this dynamically, I don’t know the id.
Does that make sense?
-
This reply was modified 7 years, 6 months ago by
CRAIG HALLER.
02/05/2019 at 1:28 pm #483642Steven Zahm
KeymasterStill not exactly sure what you are looking for…
Here’s a direct link to a specific school:
Here’s a link which filters by organization name:
Since the schools are unique, the organization filter will return a single result.
And by shortcode:
[connections organization="Abby Kelley Foster Charter Public (District): Abby Kelley Foster Charter Public School"]Do any of these help?
02/05/2019 at 2:15 pm #483647CRAIG HALLER
ParticipantIn another part of the site I have the need to use some of the information in “your” database. For instance, I want to display just the school name and phone number. I would like to be able to retrieve just that information, again only having the school name.
Right now, I made a shortcode that includes:
$data = do_shortcode([connections organization='". $org_to_show . "']);
$data contains all the information you display about the organization and all the header and footer stuff for rendering the page.
If I want the phone number I search $data for the first part of this:
< span class="phone-name">Phone< /span>< span class="cn-separator">:< /span> < a class="value" href="tel:508-854-8400" value="5088548400">508-854-8400< /a>
and can then extract just the number. I can do this for the address, etc. Then my shortcode can put out just the info I need in the format I need without all the overhead of the header, footer, etc.
So I am looking for a way to get all the strings in the database for a particular organization in a simpler way.
Live example: I am considering having people search by both your radius search and by a full map with markers. If you look at this page and click on the Haller Academy marker (by the water, over Boston), you will see a popup. It takes a while to populate with “your” data because I am dynamically creating a page with your connections shortcode and then bringing that in as an iframe. It is cool, but slow. I would rather just write out the html myself.
https://schoolorg.directory/map-testing/
Yes, I know I am being a pain in the butt, and I apologize. You have a great system and I may be pushing it a bit!
THANK YOU
-
This reply was modified 7 years, 6 months ago by
CRAIG HALLER.
-
This reply was modified 7 years, 6 months ago by
CRAIG HALLER.
-
This reply was modified 7 years, 6 months ago by
CRAIG HALLER.
-
This reply was modified 7 years, 6 months ago by
CRAIG HALLER.
-
This reply was modified 7 years, 6 months ago by
CRAIG HALLER.
-
This reply was modified 7 years, 6 months ago by
CRAIG HALLER.
02/05/2019 at 2:56 pm #483655Steven Zahm
Keymaster@ Craig
Oh, well, in this case you do not want to use the shortcode at all. Something like this:
$results = Connections_Directory()->retrieve->entries( array( 'organization' => 'Abby Kelley Foster Charter Public (District): Abby Kelley Foster Charter Public School' ) ); foreach ( $results as $data ) { /** @var cnEntry $entry */ $entry = new cnEntry( $data ); /** @var array $addresses */ $addresses = $entry->getAddresses(); /** @var array $phone_numbers */ $phone_numbers = $entry->getPhoneNumbers(); }Hope this helps!
02/05/2019 at 3:04 pm #483670CRAIG HALLER
ParticipantI will work with that and see how it goes, THANKS.
Off hand, is there a place in your code where I can see you using this so I can glean a few hints if needed?
02/05/2019 at 3:55 pm #483684Steven Zahm
Keymaster@ Craig
Since you are using the cMap template, open this file:
../wp-content/plugins/connections-cmap/card.phpThe difference from the code in my last reply is that I am using the “block” equivalents which render the HTML. Son in the template you’ll find this
$entry->getAddressesBlock();Since you want the raw data, you would use
$addresses = $entry->getAddresses();instead.Hope that makes sense.
02/05/2019 at 4:50 pm #483694CRAIG HALLER
ParticipantGreat support … Thank you.
-Craig
02/06/2019 at 9:29 am #483798Steven Zahm
Keymaster@ Craig
Thanks!
If you have a moment, I would truly appreciate a review as they really do make a difference.
https://wordpress.org/support/plugin/connections/reviews/
Thanks in advance for your time!
-
This reply was modified 7 years, 6 months ago by
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
