Show Page Attribute in Masonry Cards

Permalink Browser Info Environment
Hi,

i would like to show a created page attribute "news" in the masonry cards page list. It will be positioned in a css-styled div right before the closing tag </a> in line Line 157 in view.php:
<?php echo h($news) ?>
The variable is:
$news = $page->getAttribute('news', 'display');
As a non-programmer I can barely even tweak the built in concrete page list and of course I failed to show the news attribute in the Grand Gallery page list. I can display static text or the page title for testing in the div with:
<?php echo h($image['view_title']); ?>
but not my page attribute. Any hints?

Regards

Type: Discussion
Status: Archived
carli
View Replies:
Parasek replied on at Permalink Reply
Parasek
Hi

if you want to display any Page attribute, you can do something like that:
<?php echo h(Page::getByID($image['pageListTargetPageID'])->getAttribute('news')); ?>
carli replied on at Permalink Reply
carli
Thank you very much!

concrete5 Environment Information

vers 9.1.2
php 8.1

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.