Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.5.32
- This topic has 9 replies, 2 voices, and was last updated 6 years ago by
Steven Zahm.
-
AuthorPosts
-
03/17/2017 at 5:54 pm #416073
Vijay
GuestHello,
How can I make the “Department” field private so it does not display when “allow_public_override=’true'” is set in the page?
Thanks
VJ03/20/2017 at 9:35 am #416201Steven Zahm
Keymaster@ Vijay
re: “allow_public_override=’true’” is set in the page
In nearly all cases I highly recommend not using the
allow_public_override
shortcode option. It is virtually never needed.re: How can I make the “Department” field private
This fields can not be made private. The only thing that can be done is that the template can be be edited to the field is only rendered for logged in users.
Hope this helps!
03/20/2017 at 9:43 am #416202Vijay
GuestThanks Steven.
Can you provide details of where the template can be edited to make these only render for logged in users?
03/20/2017 at 10:13 am #416208Steven Zahm
Keymaster@ Vijay
I highly suggest reading the tutorial on how to make upgrade safe template override files.
The files you want to edit will depend on the template you wish to edit.
The included core templates can be found in this folder:
../wp-content/plugins/connections/templates/{template-folder}/
Hope this helps!
03/20/2017 at 11:01 am #416217Vijay
GuestThanks Setevn,
Yes I know how to make changes and also went through your link. I can see the cmap.php and also card.php I looked through the code, but want to pinpoint to where exactly the “Private” filter is applied so I can add the ‘Department” field there. Can you please pinpoint?
Thanks03/20/2017 at 11:46 am #416259Steven Zahm
Keymaster@ Vijay
There is no private filter for the department field. Just wrap the
$entry->getOrgUnitBlock()
block of code in an if statement that checks is a user is logged in within thecard.php
andcard-single.php
files.03/20/2017 at 12:29 pm #416264Vijay
GuestThanks. One more thing. How do I check if the user is logged in? Is there a code snippet or tag I can look at in card.php? I see this:
if ( $atts[‘show_org’] || $atts[‘show_dept’] ) {
$entry->getOrgUnitBlock(but I see the same for Address, email etc. too. So couldn’t figure what is the IF condition to see if the user is logged in.
Thanks for your continued help.03/20/2017 at 2:27 pm #416272Steven Zahm
Keymaster@ Vijay
re: How do I check if the user is logged in?
It is a core WordPress function
is_user_logged_in()
re: Is there a code snippet or tag I can look at in card.php?
Change
if ( $atts['show_org'] || $atts['show_dept'] ) {
toif ( is_user_logged_in() ) {
Now only logged in users will see the org/department field.
Good luck.
03/20/2017 at 4:40 pm #416284Vijay
GuestThanks so much Steven. This seemed to work very nicely.
After doing some more testing I’ll close this forum issue.
Your help is Appreciated.03/20/2017 at 6:24 pm #416302Steven Zahm
Keymaster@ Vijay
Great to hear!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.