Troubles with Overriding Express_Entry_List
Permalink
I'm trying to display Team member info in custom card. I have populated the Team Members express object, and placed an Express Entry List block onto the page. I then configured the block to grab the team members.
I've copied the entire Express entry list folder from Concrete/blocks to Application/blocks, and then i replaced the content of view.php with what you see below. It hangs the page (meaning no part of the page appears). Clearly, I'm missing some really important things. Your help is greatly appreciated.
I've copied the entire Express entry list folder from Concrete/blocks to Application/blocks, and then i replaced the content of view.php with what you see below. It hangs the page (meaning no part of the page appears). Clearly, I'm missing some really important things. Your help is greatly appreciated.
if ($entity) { ?> $results = $result->getItemListObject()->getResults(); if (count($results)) { ?> <section class="container-fluid"> <div class="row active-with-click justify-content-md-center"> <?php foreach ($result->getItems() as $item) { $member = $item->getEntry(); ?> <div class="col-md-4 col-sm-6 col-xs-12"> <article class="material-card Purple"> <h2><span><?=$member->getName()?></span> <strong><i class="fa fa-fw fa-star"></i><?=$member->getPosition() ?></strong></h2> <div class="mc-content"> <div class="img-container"> <img class="img-responsive" src="<?=$member->getImage() ?>"> </div>
Viewing 15 lines of 57 lines. View entire code block.
Those namespaces look the same to me?
Oops! I guess i was being a bit hasty. Let me fix it. However, that is ONLY needed if you're actually overriding the whole block... not if you want to create a custom template
I found the Ultimate Solution. As it turns out the Pixel 2 theme I was using had already implemented some custom templates for the express entry list. What I found there was far superior to anything I found anywhere. It seems the folks who created Pixel 2, REALLY know c5 and the Entity models. The code below includes functionality for searching (which I don't need, but you might):
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $c = Page::getCurrentPage(); if ($tableName) { ?> <h2><?php echo $tableName?></h2> <?php if ($tableDescription) { ?> <p><?php echo $tableDescription?></p> <?php } ?> <?php } if ($entity) { ?> <?php if ($enableSearch) { ?> <form method="get" action="<?php echo $c->getCollectionLink()?>"> <div class="form-inline"> <div class="form-group"> <?php echo $form->label('keywords', t('Keyword Search'))?> <?php echo $form->text('keywords')?>
Viewing 15 lines of 124 lines. View entire code block.
I needed to change:
namespace Concrete\Block\ExpressEntryList;
To:
namespace Application\Block\ExpressEntryList;
Now I need to figure out how to get the URL of an image from an express entry object.