• Resolved Marc

    (@marcwp7)


    Is there any way to make the Directory page only visible to logged in users (disabling it is also useful), but keeping the public profiles visible to guests (they will land knowing the url)?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Steven

    (@shazahm1hotmailcom)

    To clarify, you want the visitors, not logged in to be able to see the directory entries, but keep the directory page private for logged in users only?

    Publish the page, but do not add it to the site’s nav, this way visitors will have to know the URL.

    Publish the directory entries as Public for non-logged in users to view. Publish the directory entries as Private for logged in users to view.

    Does that help, please let me know.

    Thread Starter Marc

    (@marcwp7)

    Hi Steven,

    yes, you have understood everything I need.

    And I’ve already removed the directory page from the site’s nav, but anyone can see the url and easily figure out what the directory page is.
    Just removing the last part starting with “/name/…”.

    Examples:
    1) https://site1.com/small-business-advisor-network/name/bruce-h/
    Directory page https://site1.com/small-business-advisor-network
    2) https://site2.org/scientific-advisory-council/name/shreya-b/
    Directory page https://site2.org/scientific-advisory-council

    Plugin Author Steven

    (@shazahm1hotmailcom)

    Instead of embedding the directory on the site… you could use the [cn-entry] shortcode, create a page for each directory entry and embed just one directory entry.

    I hope this helps; please let me know.

    Thread Starter Marc

    (@marcwp7)

    Yes, that solution could be acceptable for a small amount of entries, but if there are hundreds of entries as in my case, creating a page manually for each one, doesn’t seem to be a good thing.

    Anyway, I’ve managed to solve it for now by making a very small modification in the Plugin code.

    In the file “connections/includes/Shortcode/Entry_Directory.php”, where it says:

    if ( $isSingle ) {
    	array_push( $class, 'cn-template-is-single' );
    }
    

    I have changed it to:

    if ( $isSingle ) {
    	array_push( $class, 'cn-template-is-single' );
    } else {
    	return '';
    }
    

    This way the directory page is as if it is disabled as it doesn’t show anything, and all the entries show everything fine.

    I think the Plugin should add an option to apply this setting or at least some parameter in the shortcode [connections] or a filter.

    Plugin Author Steven

    (@shazahm1hotmailcom)

    Here’s an alternative that would not require editing the plugin code…

    Add category='9999999999999' to the existing [connections] shortcode on your directory page. This effectively sets the results list to a category that does not exist so that none will be shown. But if you link directly to the directory entry detail/profile page, it can be viewed.

    Does that help?

    Thread Starter Marc

    (@marcwp7)

    Great, that parameter achieves the result I was looking for.

    Thank you very much!

    Plugin Author Steven

    (@shazahm1hotmailcom)

    Good to hear; have a great day!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Directory page for logged in users only and keep public profiles’ is closed to new replies.