Forum Replies Created
-
AuthorPosts
-
Steven Zahm
Keymaster@ Alaa
Add a link to the bio field and use a template which displays the bio field. Does that answer the question?
Steven Zahm
Keymaster@ Oliver
Assuming the only page you want to hide it on is this one:
http://www.gymnasium-brake.de/personen/kollegium-2/This should work:
.page-id-204 #cn-list span.organization-unit { display: none; }If that is not the page you want to hide it on, just change
204to the correct page ID.05/24/2014 at 5:56 pm in reply to: How to add text to the Edit My Directory Entry page [second try] #291999Steven Zahm
Keymaster@ Eric
re: paths
The paths would be relative to Code Snippets, not Link. I suggest not putting the API files within a plugin folder. Any update will delete the files. Your best course of action is to write your own plugin rather than using Code Snippets that way the API files can reside in your custom plugin. Code Snippets is fantastic for prototyping, testing actions/filters and adding one-off actions/filters but there are limits.Creating a plugin is easy. Just add the plugin header text to the top of a php file, paste in the snippets I gave you after the plugin header text, deactivate the snippets you added, create a new folder in the plugins folder, copy your php file to that new folder and activate your new plugin.
re: instruction action
The action will only work with the betas, not the version you have installed.re: I only want the data to prepopulate when a new directory entry is being added
Right, you’ll have to add conditional code to make sure that happens only when adding a new entry.re: default for new entries was to make them either Private or Unlisted. I’d like to set the default to be Public
As of Connections 0.8.6, the default is to be Public.re: Also, I’d like to set this up for Individuals only, rather than providing the choice of Organization too
function cn_limit_entry_type_to_individual( $atts ){ $atts['entry_type'] = array( __( 'Individual', 'connections' ) => 'individual' ); $atts['default'] = array( 'type' => 'individual', 'visibility' => 'public' ); return $atts; } // Filter to limit to the organization entry type. add_filter( 'cn_metabox_publish_atts', 'cn_limit_entry_type_to_individual' );05/24/2014 at 4:09 pm in reply to: Map,Notes and bio quickly disapearing after clicking on item #291996Steven Zahm
Keymaster@ Xavier
Good to hear. Really odd that the JDK would interfered with JS though. Never run into that before.
05/24/2014 at 2:13 pm in reply to: How to add text to the Edit My Directory Entry page [second try] #291991Steven Zahm
Keymaster@ Eric
I add two new action which you can hook into to output the instructions. Here’s snippet that will work with the beta of Link:
add_action( 'cnl_admin_before_metaboxes', 'cnl_custom_content_before' ); function cnl_custom_content_before( $action ) { switch ( $action ) { case 'add': echo '<div><p>Special Instructions when adding an entry</p></div>'; break; case 'edit': echo '<div><p>Special Instructions when editing an entry</p></div>'; break; } }05/24/2014 at 9:29 am in reply to: How to add text to the Edit My Directory Entry page [second try] #291990Steven Zahm
Keymaster@ Eric
The second line is correct. That filter is the equivalent of Form. Two filters need added; one for Form, the other for Link. Both filters call the same function.
For those two filters, you need to make a change to Link, the one I mentioned here on line 37. I’ll try to get both the betas for Form and Link over to you today.
As to how to use the snippet…
A quick look at the code you gave… you should be able to past it after the two cache filter lines. Remove the echos. You can not echo within a filter. Replace my dummy data with the variables from you code. Something like this:
add_filter( 'cnl_admin_add_entry_object', 'cnl_alter_add_entry_object' ); add_filter( 'cnf_add_entry_object', 'cnl_alter_add_entry_object' ); function cnl_alter_add_entry_object( $entry ) { // Add the filters necessary to save data in the cache. add_filter( 'cn_email_cached', '__return_true' ); add_filter( 'cn_address_cached', '__return_true' ); include_once '/dap/dap-config.php'; if ( Dap_Session::isLoggedIn() ) { $session = Dap_Session::getSession(); $user = $session->getUser(); $email = $user->getEmail(); // ACCESS USER INFO FROM INFUSIONSOFT API include_once 'isdk.php'; $myApp = new iSDK; if ( $myApp->cfgCon( 'demo' ) ) { $returnFields = array('Id', 'FirstName', 'LastName', 'City', 'State', 'Country'); $data = $myApp->findByEmail( $email, $returnFields ); $entry->setFirstName( $data['0']['FirstName'] ); $entry->setLastName( $data['0']['LastName'] ); // Setup the email data to prepopulate. $email = array(); $email[1] = array(); $email[1]['type'] = 'personal'; $email[1]['address'] = $email; // Store the email address in the cache. $entry->setEmailAddresses( $email ); // Setup the address data to prepopulate. $address = array(); $address[1] = array(); $address[1]['type'] = 'home'; $address[1]['city'] = $data['0']['City']; $address[1]['state'] = $data['0']['State']; $address[1]['country'] = $data['0']['Country']; // Store the address data in the cache $entry->setAddresses( $address ); } else { echo '<p>Infusionsoft connection error.</p>'; } } return $entry; }05/24/2014 at 9:07 am in reply to: Map,Notes and bio quickly disapearing after clicking on item #291989Steven Zahm
Keymaster@ Xavier
I just visited your site in Chrome, Firefox and IE; latest versions. In all three browsers cMap seems to functioning correctly. I’m guessing the issue has been resolved? Let me know.
05/23/2014 at 5:34 pm in reply to: How to add text to the Edit My Directory Entry page [second try] #291978Steven Zahm
Keymaster@ Eric
Lets see…
re: starting on line 25
Ok, I was contemplating on adding an action to one could target either the add or edit. That way different instructions can be given based on the users action.re: Where exactly do these code snippets get added?
There’s several options. You could write you’re own plugin and drop the snippets in it. Another option is to drop it in the theme’s functions.php file. My personal favorite is installing Code Snippets. You could add the code I gave you as a new snippet. That’s the method I was using to test the filter to make sure it worked as expected.re: when will Link 2.0 and Form 2.0 be released?
Best I can say… sooner rather than later. I see you purchase the Pro Pack — I can send you advanced copies. Having someone using them will help to find any remaining issues that I need to address before the official release. Is the email address on you account where I should send them?re: 3) The Member Home Page has a link offering people the opportunity to Add a Directory Entry.
With the beta Form and Link, you could send them to a page with Form instead. Although, it sounds link you could create a “bridge” with DAP and automatically add them to Connections too. I am willing to bet they have an action that you could hook into post registration and programmatically add them to Connections. The you would only need to add a “View My Entry” link. When they visit it while logged in, they’ll be presented with an option to edit their entry.
re: By the way, I love the idea that you would provide a hook for customizing the Directory form
With the action hooks, you could echo out anything you want… Can you attach a screen capture of your manage page with the instructions? Just so I can see. Before I send you the betas, I’ll add the action(s).
regards…
Steven Zahm
Keymaster@ cheryl
Ok, you would use this shortcode to remove the bio:
[connections str_bio_head=""]That should do it.
Steven Zahm
Keymaster -
AuthorPosts
