This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

david19236
david19236

I have a backend list for my plugin and on one of the fields for the list of records I have set the type to partial.

In the partial file I want to be able to use a current record's field value with some HTML example: $myrecord_id Unfortunately I cannot seem to get the field value for the current position in the iteration as the list creates each row. I notice that what is exposed to the Partial is the entire record set containing many records. $this-widget.

Does the column type of partial render prior to the creation of the list so that PHP in that column partial is not evaluated for each record?

if the above answer is NO, then how do I access my model so I can get a field value for the record at the current position in the iteration?

Shantarli
Shantarli

https://octobercms.com/docs/backend/lists#column-partial

Current model on the row is the $record variable. Little partial example which i use to make preview inside my list:

<?php
    echo "<h4>" . $record->name . "</h4>";
    echo $record->content;
?>

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.