Answers.Body: <p>2 options:</p>
  <ol>
  <li><p><strong>As a CiviCRM path:</strong> Set a path for your form in the FormBuilder UI, and be sure to check the &quot;Accessible on front-end of website&quot; box to make it available to non-CiviCRM users. For testing purposes you can allow all users to view the form although you may be able to refine that permission if you have a specific permission granted to members.
  <a href="https://i.sstatic.net/WCaCN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WCaCN.png" alt="FormBuilder" /></a></p>
  </li>
  <li><p><strong>As a WordPress page with shortcode:</strong> Create a normal wordpress page or post and give your members appropriate access to view it. Embed your FormBuilder form onto that page with a shortcode, which is in the format:</p>
  </li>
  </ol>
  <pre><code>[civicrm component=&quot;afform&quot; name=&quot;fullNameOfMyForm&quot;]
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-08T00:45:30.100Z
Answers.Text: I've tried both of these (as noted in my original post). The 1st works when I'm logged in (as an admin user), but even with the anonymous, nothing shows when I view it in an incognito window. The 2nd doesn't work, even when I'm logged in editing and previewing the page.
Answers.UserDisplayName: Mark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-08T00:52:51.000Z
Answers.Text: If I turn off "Enforce Permissions" on the SearchKit results, then the FormBuilder one does work (still with anonymous access to the form). Changing that setting did not make the WordPress shortcode page work. I'll head down the FB path to see if I can now lock things down so only members can view the results.
Answers.UserDisplayName: Mark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-08T13:16:57.040Z
Answers.Text: What does "doesn't work" mean wrt the shortcode? Can you double-check the name? Should match exactly the filename of the afform minus the `.aff.html` suffix.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-21T01:49:01.353Z
Answers.Text: I confirmed the name by copying the filename and comparing it to the shortcode. It matches exactly. "Doesn't work" means that the HTML angular tags get output, but the browser console shows javascript errors and nothing ever renders on the front end. I'll update the main question with the details.
Answers.UserDisplayName: Mark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-06T18:08:38.130Z
Answers.LastActivityDate: 2024-02-06T18:08:38.130Z
Answers.UserDisplayName: Coleman
Body: <p>I have created a searchkit query and results of our membership listing that I want to allow all the new and current members to be able to access.</p>
  <p>I tried a searchkit display page (with a URL like &quot;example.com/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fsearch#/display/Membership_Directory/Membership_Directory_List_1&quot;), but I can't figure out how to allow members to access that page.</p>
  <p>I tried the same searchkit results showing in formbuilder, but I can't get it to show the results, even if I back the &quot;Permission&quot; to &quot;Generic: Allow all users (including anynous)&quot;.</p>
  <p>How do I show the results on a page within the WordPress site (using an embed code? or as a CiviCRM AFForm?) that is restricted to viewing by only current members? What rights do they need? What am I missing?</p>
  <p><strong>March 20, 2024 Update</strong>
  Based on comment feedback below, here is a clarification of what happens in a WordPress page using the shortcode for the AFForm.</p>
  <p>The permission in the FormBuilder is set to anonymous:
  <a href="https://i.sstatic.net/6GrSG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6GrSG.png" alt="enter image description here" /></a></p>
  <p>The short code I'm using in the WordPress page is set to the form name:</p>
  <pre><code>[civicrm component=&quot;afform&quot; name=&quot;afsearchMembershipDirectory&quot; hijack=&quot;0&quot;]
  </code></pre>
  <p>The site renders this in the HTML source:</p>
  <pre><code>&lt;div class=&quot;wpb_wrapper&quot;&gt;
    &lt;div class=&quot;crm-container&quot; id=&quot;bootstrap-theme&quot;&gt;
      &lt;crm-angular-js modules=&quot;afsearchMembershipDirectory&quot;&gt;
         &lt;afsearch-membership-directory&gt;&lt;/afsearch-membership-directory&gt;
      &lt;/crm-angular-js&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>But the browser console shows errors like this and never displays anything:</p>
  <pre><code>Uncaught SyntaxError: expected expression, got '&lt;'
  </code></pre>
  
Tags: <wordpress><searchkit><search-results><formbuilder>
Title: How do you display searchkit results, tables, lists, on members-only pages within WordPress?
ThreadText: # How do you display searchkit results, tables, lists, on members-only pages within WordPress?
  
  (Asked by: username_0 on 2024-02-06)
  
  I have created a searchkit query and results of our membership listing that I want to allow all the new and current members to be able to access.
  I tried a searchkit display page (with a URL like "example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fsearch#/display/Membership_Directory/Membership_Directory_List_1"), but I can't figure out how to allow members to access that page.
  I tried the same searchkit results showing in formbuilder, but I can't get it to show the results, even if I back the "Permission" to "Generic: Allow all users (including anynous)".
  How do I show the results on a page within the WordPress site (using an embed code? or as a CiviCRM AFForm?) that is restricted to viewing by only current members? What rights do they need? What am I missing?
  March 20, 2024 Update
  Based on comment feedback below, here is a clarification of what happens in a WordPress page using the shortcode for the AFForm.
  The permission in the FormBuilder is set to anonymous:
  
  The short code I'm using in the WordPress page is set to the form name:
  [civicrm component="afform" name="afsearchMembershipDirectory" hijack="0"]
  
  The site renders this in the HTML source:
  
    
      
         
      
    
  
  
  But the browser console shows errors like this and never displays anything:
  Uncaught SyntaxError: expected expression, got '<'
  
  **Tags:** wordpress, searchkit, search-results, formbuilder
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-02-06. Score: 2
  
  2 options:
  
  As a CiviCRM path: Set a path for your form in the FormBuilder UI, and be sure to check the "Accessible on front-end of website" box to make it available to non-CiviCRM users. For testing purposes you can allow all users to view the form although you may be able to refine that permission if you have a specific permission granted to members.
  
  
  As a WordPress page with shortcode: Create a normal wordpress page or post and give your members appropriate access to view it. Embed your FormBuilder form onto that page with a shortcode, which is in the format:
  
  
  [civicrm component="afform" name="fullNameOfMyForm"]
  
  > **Comments:**
  > **username_0**: I've tried both of these (as noted in my original post). The 1st works when I'm logged in (as an admin user), but even with the anonymous, nothing shows when I view it in an incognito window. The 2nd doesn't work, even when I'm logged in editing and previewing the page.  
  > **username_0**: If I turn off "Enforce Permissions" on the SearchKit results, then the FormBuilder one does work (still with anonymous access to the form). Changing that setting did not make the WordPress shortcode page work. I'll head down the FB path to see if I can now lock things down so only members can view the results.  
  > **username_1**: What does "doesn't work" mean wrt the shortcode? Can you double-check the name? Should match exactly the filename of the afform minus the `.aff.html` suffix.  
  > **username_0**: I confirmed the name by copying the filename and comparing it to the shortcode. It matches exactly. "Doesn't work" means that the HTML angular tags get output, but the browser console shows javascript errors and nothing ever renders on the front end. I'll update the main question with the details.  
  
  ---
  
  