Forum Replies Created
-
AuthorPosts
-
George Socha
ParticipantI am trying to get at this yet another way but with no luck. What php code would I add to the custom cmap template file to retrieve the contents of a custom field?
I can tell that the contents are stored in the “connections_meta” table. Part of the information is in the “meta_key” field; that information is the name of the field. Part of the information is in the “meta_value” field; that information is the contents that I want to display.
Thanks!
George Socha
ParticipantSteve,
Could you point me to an example of how a can have a custom field pull data from a field, such as the name of an organization?
Thanks,
George
George Socha
ParticipantAs a first step, I am thinking of creating a custom field that lets me select one organization name from a list of all organization names.
I can create a custom field that lets me enter text.
I have not yet figured out how to create a custom field that lets me select one existing organization from a list of all existing organizations.
Any suggestions?
Thanks.
George Socha
ParticipantSteve,
I am not sure how that works. I am not creating a separate page for each entity but rather relying on the card-single.php template. That means that, as far as I can tell, there is no place for a shortcode.
Thanks,
George
George Socha
ParticipantSteve,
That did it. Thanks again!
George
George Socha
ParticipantFor each of the others, I tried to add the additional if statement.
Here is the code when I add the if statement for the “Phones” tab:
if ($atts['show_phone_numbers'] !== '') { if ( $entry->getPhoneNumberBlock() ) { echo '- '; echo '<input type="radio" name="tabs" id="tab4">'; echo '<label for="tab4">Phone</label>'; echo '<div id="tab-content4" class="tab-content animated fadeIn">'; if ( $atts['show_phone_numbers'] ) echo $entry->getPhoneNumberBlock( array( 'format' => $atts['phone_format'] , 'type' => $atts['phone_types'] ) ); echo '</div>'; echo '
'; } }Attached is a screenshot of what happens when I add that if statement.
Thanks,
George
Attachments:
You must be logged in to view attached files.George Socha
ParticipantSteve,
That both worked and did not work. It worked for these tabs: Email; and Messages. It did not work for these tabs: Social Media; Addresses; Phone; Dates; and Categories.
Here is the code that is working:
<?php echo '<hr class="thin" />'; echo '<ul class="tabs">'; echo '- '; echo '<input type="radio" name="tabs" id="tab1" checked>'; echo '<label for="tab1">Links</label>'; echo '<div id="tab-content1" class="tab-content animated fadeIn">'; if ( $atts['show_links'] ); $entry->getLinkBlock( array( 'format' => $atts['link_format'], 'type' => $atts['link_types'] ) ); echo '</div>'; echo '
'; echo '- '; echo '<input type="radio" name="tabs" id="tab2">'; echo '<label for="tab2">Social Media</label>'; echo '<div id="tab-content2" class="tab-content animated fadeIn">'; if ( $atts['show_social_media'] ) $entry->getSocialMediaBlock(); echo '</div>'; echo '
'; echo '- '; echo '<input type="radio" name="tabs" id="tab3">'; echo '<label for="tab3">Addresses</label>'; echo '<div id="tab-content3" class="tab-content animated fadeIn">'; if ( $atts['show_addresses'] ) echo '<div class="four-columns">' , $entry->getAddressBlock( array( 'format' => $atts['addr_format'] , 'type' => $atts[''] ) ) , '</div>'; echo '</div>'; echo '
'; echo '- '; echo '<input type="radio" name="tabs" id="tab4">'; echo '<label for="tab4">Phone</label>'; echo '<div id="tab-content4" class="tab-content animated fadeIn">'; if ( $atts['show_phone_numbers'] ) echo $entry->getPhoneNumberBlock( array( 'format' => $atts['phone_format'] , 'type' => $atts['phone_types'] ) ); echo '</div>'; echo '
'; if ($atts['show_email'] !== '') { if ( $entry->getEmailAddresses() ) { echo '- '; echo '<input type="radio" name="tabs" id="tab5">'; echo '<label for="tab5">Email</label>'; echo '<div id="tab-content5" class="tab-content animated fadeIn">'; if ( $atts['show_email'] ) echo $entry->getEmailAddressBlock( array( 'format' => $atts['email_format'] , 'type' => $atts['email_types'] ) ); echo '</div>'; echo '
'; } } if ($atts['show_im'] !== '') { if ( $entry->getImBlock() ) { echo '- '; echo '<input type="radio" name="tabs" id="tab6">'; echo '<label for="tab6">Messenger</label>'; echo '<div id="tab-content6" class="tab-content animated fadeIn">'; if ( $atts['show_im'] ) echo $entry->getImBlock(); echo '</div>'; echo '
'; } } echo '- '; echo '<input type="radio" name="tabs" id="tab7">'; echo '<label for="tab7">Dates</label>'; echo '<div id="tab-content7" class="tab-content animated fadeIn">'; if ( $atts['show_dates'] ) echo $entry->getDateBlock( array( 'format' => $atts['date_format'], 'type' => $atts['date_types'] ) ); echo '</div>'; echo '
'; echo '- '; echo '<input type="radio" name="tabs" id="tab8">'; echo '<label for="tab8">Categories</label>'; echo '<div id="tab-content8" class="tab-content animated fadeIn">'; if ( $atts['show_categories'] ) echo cn_display_terms_of_parent_term_id( 35, $entry->getCategory() ); echo '</div>'; echo '
'; echo ''; ?>I have no idea why some tabs work and others do not.
Thanks,
George
George Socha
ParticipantSteve,
Using CSS and HTML to set up tabs, I have been able to able to expand and collapse blocks of information that show up in the single-entry view of cMap. Here is an example: http://www.edrm.net/apersee/name/advanced-discovery
I am trying to figure out how to make a tab appear only if there is content. In the example, I want the “Phone” tab to appear as there is a phone number, drawn from the
phone_numbersfield, that should be displayed. I want the “Email” tab not to appear, as there is not entry in theemailfield for this entity’s record.I have tried various permutations of the following but with no success:
if ($atts['show_email'] !== '') { echo '- '; echo '<input type="radio" name="tabs" id="tab5">'; echo '<label for="tab5">Email</label>'; echo '<div id="tab-content5" class="tab-content animated fadeIn">'; if ( $atts['show_email'] ) echo $entry->getEmailAddressBlock( array( 'format' => $atts['email_format'] , 'type' => $atts['email_types'] ) ); echo '</div>'; echo '
'; }I suspect that my problem is with this line and that I should be using something other than
show_email:if ($atts['show_email'] !== '') {Any suggestions?
Thanks,
George
George Socha
ParticipantSteve,
I have columns working but there is a refinement I have not figure out how to accomplish. If I enter just one address, it spans several columns (I am using 4 columns) instead of showing up all in a single column. Here is an example: http://www.edrm.net/apersee/name/falcon-discovery
When I enter multiple addresses, the individual addresses do not necessarily stay together. Instead, one address might begin at the end of one column and end at the beginning of a second column. Here is an example: http://www.edrm.net/apersee/name/advanced-discovery
I would like each address to stay in just one column.
How might I take care of this problem?
Thanks,
George
George Socha
ParticipantSteve,
Here is a more detailed explanation, with an attached spreadsheet to help illustrate what I mean.
Assume entries for five organizations. Four orgs have addresses which include states. One org has two addresses which include states. One org does not have any addresses. The entries look like this:
Org A State A Org B State B, State A Org D State C Org C Org E State BIf ordered by Org only, the list should look like thise:
Org A State A Org B State B, State A Org C Org D State C Org E State BI would expect that if ordered by Org and then State, the list would look like this, which is what Excel does:
Org A State A Org B State A, State B Org C Org D State C Org E State BInstead, when ordered by Org and then State, the results are something like this, with the one Org that has no State at the end so that Org C comes after Org E even though C comes before B in the alphabet:
Org A State A Org B State A, State B Org D State C Org E State B Org CI hope this explains better what I meant.
George
Attachments:
You must be logged in to view attached files. -
AuthorPosts
