Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted December 15, 20177 yr Hi, I'm really struggling to try and work out how to use fields in pages app and I'm not finding the documentation very clear. I'm trying to have a select field for when I setup a database record, on selection it will change the value of a piece of code in the record. E.g. on record entry I select paid member value would be XXX, this would then change the value in a piece of code {{$url = $package->url()->csrf()->setQueryString( array( "package_{$package->id}_submitted" => XXX, "quantity" => 1 ) );}} <a href='{$url}'>Buy Now</a> Thanks in advance
December 15, 20177 yr I think that should be doable with {$record->customFieldDisplayByKey('field_unique_key', 'display')|raw} or {$record->fieldValues()['field_xx']} where you've got XXX. That will only work if 1) the field has a value (so either make it required or put in an {{if}} check, and 2) if the field values happen to be the numbers you want to appear. If they're not, you'll have to put some conditions in so that if the field value is x, then the value in the record is y.
December 18, 20177 yr Author Thanks for your help @Meddysong sorry I'm completely new to this, where does each bit of code go?
Archived
This topic is now archived and is closed to further replies.