Skip to Content Skip to Menu

CB File Field Plugin - Hide field and tabs when there is no file

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 2 months ago #232602 by nant

harleylever wrote: Hi Nant,

While I agree that it works as designed, the design conflicts with a feature that is inherent to all other field types in Community Builder. I paid for the file field plugin assuming it would work exactly like all other fields and would be able to be hidden if the file field and/or tab were empty... this is how every other field-type works. So why would I assume a file field would not work the same exact way as the other fields?


Because by default it is an AJAX file field, which means that it is set for frontend editing.

If you want it to work like the other fields then disable the Ajax setting in the file field parameter area.

I have tested this and if you simply turn off Ajax on your file field then the tab and field will not show up if you have configured CB Configuration -> User Profile relevant parameters to not show empty fields or empty tabs.

Please Log in or Create an account to join the conversation.

11 years 2 months ago #232684 by harleylever
Hi Nant,

Thank you for the reply. I have followed your instructions, however there appears to be a hyperlinked "." in what should be an empty field. When you hover over the hyperlinked period it says "Click or right-click filename to download" even though there is no file present and I have made sure that there is no value in the "Text to display for empty fields" field under the "user profile" tab of the configuration panel.

I have disabled Ajax, have file extension icons set to "hide", notify is disabled, user read only is set to "yes", show empty tabs and empty fields is set to "no" and I have even uninstalled and reinstalled the plugin twice. However, it seems the "Hyper linked period" might be getting in the way.

I did notice within the plugin on line 973 this code in the cb.filefield.php file:
Code:
$oValue = ( ( $reason == 'edit' ) ? '<p>' : null ) . ( ( $field->params->get( 'fieldFile_icons', 0 ) == 0 ) ? $icon : null ) . '<a href="' . $oValue . '" title="' . CBTxt::T( 'Click or right-click filename to download' ) . '"> ' . $file_name . '</a>' . ( ( $reason == 'edit' ) ? '</p>' : null );[code type=php]

Is there a way to change this code to stop the the "hyperlinked period" from occupying what should be an empty field?

Thanks again Nant.

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 2 months ago #232696 by nant

harleylever wrote: Hi Nant,

Thank you for the reply. I have followed your instructions, however there appears to be a hyperlinked "." in what should be an empty field. When you hover over the hyperlinked period it says "Click or right-click filename to download" even though there is no file present and I have made sure that there is no value in the "Text to display for empty fields" field under the "user profile" tab of the configuration panel.

I have disabled Ajax, have file extension icons set to "hide", notify is disabled, user read only is set to "yes", show empty tabs and empty fields is set to "no" and I have even uninstalled and reinstalled the plugin twice. However, it seems the "Hyper linked period" might be getting in the way.

I did notice within the plugin on line 973 this code in the cb.filefield.php file:

Code:
$oValue = ( ( $reason == 'edit' ) ? '<p>' : null ) . ( ( $field->params->get( 'fieldFile_icons', 0 ) == 0 ) ? $icon : null ) . '<a href="' . $oValue . '" title="' . CBTxt::T( 'Click or right-click filename to download' ) . '"> ' . $file_name . '</a>' . ( ( $reason == 'edit' ) ? '</p>' : null );[code type=php]

Is there a way to change this code to stop the the "hyperlinked period" from occupying what should be an empty field?

Thanks again Nant.


I cannot verify what you are seeing.

In my testing environment:

Joomla 2.5.9 / CB 1.9 / CB Filed Field 1.6

I have a new tab called New-tab that has a single file field in it cb_file where I have:

File Extension icons: Show
Notify: Enable
Send File: Disable
..
Ajax: Disable

In CB Configuration I have specified that empty fields and empty tabs are to be hidden.

With these settings when I visit my profile I see no New-Tab in profile view mode.
In Profile edit mode I see the New-tab with the single file field ready to accept upload.

Not sure what more to tell you here.

Please Log in or Create an account to join the conversation.

11 years 2 months ago #232730 by harleylever
Hi Nant,

I have the same exact environment. Here is the picture of what I am getting with the "hyperlinked periods". Each one that only show the hyperlinked periods have the same configuration you have instructed me to set the field to.




If I renew my membership, is this something someone can come to the site and take a look at?
Attachments:

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 2 months ago - 11 years 2 months ago #232738 by nant

harleylever wrote:
If I renew my membership, is this something someone can come to the site and take a look at?


I will certainly take a look, but as I am sure that if you do a test on a clean joomla/cb site with settings I gave you will see things working.

P.S. I don't see you have ever been a Professional or Advanced member, so I am not sure what you intend to renew.
Last edit: 11 years 2 months ago by nant.

Please Log in or Create an account to join the conversation.

11 years 2 months ago #232747 by harleylever
I have signed multiple clients up as members and acted on their behalf... sometimes it is hard to keep track of my Community Builder personalities. :)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum