This topic is locked
[SOLVED]

 Hide fields in View page

10/18/2012 6:31:09 AM
PHPRunner General questions
S
scoobysteve author

I am running the latest PHPR and would like to hide some fields is it enough to just add the following to hide a field, because I have tried this and it does not work
$xt->assign("NameFirst_fieldblock",false); or

$xt->assign("NameFirst_fieldblock",true);
Each user is required to logon to see other users profiles, but I want it to be that if one field has a value in it, it hides another field. If I use either of the above in the Before display event the

filed is still seen, I know I will need a IF statement but for now I am just trying to prove this code does in fact block a field from being seen and so far it does not, nay help please.
Thanks
Steve

C
cgphp 10/18/2012

Make sure NameFirst is the real name of the field.

S
scoobysteve author 10/18/2012

Thanks,
OK checked this still the same it wont work on any field name, all I am doing is adding this code in the before display event exactly as is seen here.
$xt->assign("NameFirst_fieldblock",true);
that is it nothing else in the whole event should there be anything else, I have tried both true and false in the statement
Regards

Steve

Sergey Kornilov admin 10/18/2012

You need to make sure field name is correct (case-sensitive) and use false to hide the field. Just double-checked on test project - it works.

S
scoobysteve author 10/19/2012



You need to make sure field name is correct (case-sensitive) and use false to hide the field. Just double-checked on test project - it works.


I have made sure the type is correct and tried it on various field names. But nothing changes.
Is it enough just to have that one line of code per field in the event to prevent a filed from being displayed
BTW I also tried the false statement. the field I am trying to prevent from being displayed

are images called ADDImage1-ADDImage6 so I have tried the following without any success.
$xt->assign("ADDImage1_fieldblock",false);

$xt->assign("ADDImage2_fieldblock",false);

$xt->assign("ADDImage3_fieldblock",false);

$xt->assign("ADDImage4_fieldblock",false);

$xt->assign("ADDImage5_fieldblock",false);

$xt->assign("ADDImage6_fieldblock",false);
strange

Sergey Kornilov admin 10/19/2012

If you have a valid support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

S
scoobysteve author 10/20/2012



If you have a valid support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


I have just tried this but there is a zip file size limit of 25Mb and it fails to upload.

This is how it looks in the event but both these fields can be see in the view page.

C
cgphp 10/20/2012

Post the screenshot of the View page in the Visual Editor.

S
scoobysteve author 10/20/2012



Post the screenshot of the View page in the Visual Editor.


Here it is Cristian, thanks

C
cgphp 10/20/2012

I see you have a custom design for the view page. Dragging the fields in the editor you have accidentally removed the fieldblock marker before and after each field.

You can fix this problem following these steps:

  1. Click the yellow label in the Visual editor corresponding to the field you want to hide (for example Year)
  2. Switch to HTML mode
  3. The var template for the Year field will be highlighted: {$Year_value}
  4. Before and after the temaplate var add the markers: {BEGIN Year_fieldblock}{$Year_value}{END Year_fieldblock}

S
scoobysteve author 10/20/2012

Thanks Cristian,
I will have a look at this and see if it helps, thanks again

Steve