Hello. I am fairly new to PHPR and am using 5.3. I have a situation where I have an edit page, so most of the fields on this page are set to display as editable. I have some fields on the page that I need to show editable in one place, but NOT editable in another. I have come up with a bit of a workaround, but I wanted to see if there is a better way.
The first thing I tried was using the smarty tag that the view page uses. So for example, I have a field called NewTerm. In the HTML of the edit page, that field is referenced as:
{$NewTerm_editcontrol}
Simple enough. In the View page, it is referenced as:
{$NewTerm_value}
Also pretty simple. So I figured why not put the _editcontrol version of the reference where I need the field to be edited and the _value version of the reference where I need it statically displayed. Nope. The edit page didn't seem to recognize the _value version and didn't display anything. That should have been so simple...
So my workaround involved me basically making a copy of each field I needed to do this with in the SQL and alias it as something else. So my SQL looks like this:
...
NewTerm,
NewTerm AS NewTermStatic,
...
Now I can reference {$NewTerm_editcontrol} where I want it to be edited and {$NewTermStatic_editcontrol} (and set the property to read-only) where I want it to NOT be editable.
Workable solution, I suppose, but messy indeed. I was wondering if anyone had a more elegant or "proper" way to do this. I feel like I was on to something with the first attempt and it seemed like the most simple solution, but it just didn't work.
Any ideas much appreciated. Otherwise for anyone else with this scenario, you're welcome for a klunky workaround until a better solution is found!
Thanks