My front page contains say 3 different views and each view has 10 rows. My requirement is Links which were not published to the frontpage the last time the user loaded it should be highlighted. I am using common template file for field shown on front page. (that is title file with anchor tag having link to some URL) Example in image :
I am having no idea how I can achieve this, I tried searching lot but I have idea that this can be possible with cookies.
Please suggest that will be very helpful !!
Thanks :)
UPDATE :
I have set nid values in cookie with below logic :
function custom_views_pre_render(&$view) {
//frontpage highlight
if (current_path() == "frontpage") {
if (!empty($view->result)) {
$nids = array();
foreach ($view->result as $res) {
$nids[] = $res->nid;
}
if(!isset($_COOKIE['FrontPage'])) {
setcookie("FrontPage[$view->name]", implode(',', $nids), time() + (3600 * 24 * 5), '/');
}
}
}
Now I need to compare values of each row nid with in this array.