Issue at hand is shortcode output of permissions error. Anons and logged in users of all kinds can view whole list at ?page=CiviCRM&q=civicrm%2Fprofile&force=1&gid=14
without issue. Shortcode gives errors for all users including admin.
I went over the steps mentioned here Creating a public Members directory with CiviCRM in Wordpress using Profiles
Read http://book.civicrm.org/user/current/organising-your-data/profiles/ and http://wiki.civicrm.org/confluence/display/CRMDOC/Access+Control+Context+and+Overview multiple times
My situation is that anonymous users and logged in users of all kinds can access and search full list of members at ?page=CiviCRM&q=civicrm%2Fprofile&force=1&gid=14
without issue.
When logged in as admin Shortcode [civicrm component="profile" gid="14" mode="view"]
outputs "Permission Denied You do not have permission to view this contact record. Contact the site administrator if you need assistance." Have also tried adding force="1" to shortcode to emulate url of successful view.
Calling in template while logged in <?php do_shortcode('[civicrm component="profile" gid="14" mode="view"]'); ?>
outputs nothing at all.
When not logged in shortcode interrupts page drawing and outputs Sorry but we are not able to provide this at the moment.
Could not find the required contact id parameter (id=) for viewing a contact record with a Profile.
Here are some steps I have taken: In WordPress Access Control under these items all levels including Anonymous are checked "CiviCRM: view all contacts" "CiviCRM: profile listings and forms" "CiviCRM: profile listings"
Anons cannot access "CiviCRM: profile create " and "CiviCRM: profile edit"
Under Manage Groups "Public Member List" has visibility "Public Pages" and types "Access Control, Mailing List".
Under Profiles I have "Public Directory List" used for "Standalone form or Directory" and "Search Views". Active is checked. "Limit listings to a specific Group?" is set to "Public Member List".
The Profile has two fields- first and last name. Both are set to Searchable, In Selector, and View Only. Required and Reserved are set to No. Preview button just outputs a heading and no data. Seems like that is unexpected behavior...
Created "Not Logged In" under "Manage ACL Roles"
Under "Assign Users to Roles" the assigned to only offers groups of Contacts. Setting this up for non-logged in users so they are not contacts... So confused.
Under "Manage ACLs" Role "Everyone" Operation "View" Type "Group" Which "Public Member List" Desc "View Profiles" Enabled "Yes"
I think that covers the issue.
9.24 Update:
Per @Andrei's advice I edited civicrm/includes/civicrm.shortcodes.php
on line 626 I changed
elseif ($mode == 'view') { $args['q'] = 'civicrm/profile/view'; }
to
elseif ($mode == 'view') { $args['q'] = 'civicrm/profile&force=1'; }
Interestingly I got no error but the output was not the group directory I expected:
**Update 9.25 **
Here is how I solved this for my templates:
First I used this call to fetch all groups. Dumped that data and got group ID of one I wanted. civicrm_api('Group','Get',array());
ID was 6. Now in my templates I use the following to print out the members of that group. I'm sure it could be more elegant but it does what I mean for it to do. :)
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm.settings.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php';
$config = CRM_Core_Config::singleton( );
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/api/api.php';
$group = civicrm_api('GroupContact','Get',array('group_id' => '6', 'options' => array('limit' => 1000), 'version' =>3));
if ($group['values']) {
foreach ($group['values'] as $k => $v) {
$contact = civicrm_api('Contact','Get',array('contact_id' => $v['contact_id'], 'version' =>3));
if ($contact) {
//print_r($contact); exit;
echo $contact['values'][$v['contact_id']]['display_name'] . '<br>';
}
}
}
?>