custom express entry list

Permalink
Hi,
help please
I have watched andrews video on making custom theme for express, this works for express details, but what i want is similar to a shopping cart, it should display 3 columns, has a thumb nail of the image or a image 100 or 150px, below are my other details.. name, weight, colour, etc all in a <div> and then shows the next object.
so, i have created /application/blocks/express_entry_list/templates/ and copied the view.php here and called it detailed_list.php

 
hutman replied on at Permalink Reply
hutman
Can you provide a visual of what this currently looks like vs what you want? Are you just trying to change it from a table layout to a div layout?
davetl replied on at Permalink Reply 2 Attachments
yes.
from
PineCreativeLabs replied on at Permalink Best Answer Reply 1 Attachment
PineCreativeLabs
I happen to be working on something similar to what you're describing. Below is my code for an express list custom template.
<?php defined('C5_EXECUTE') or die("Access Denied.");
$c = Page::getCurrentPage(); 
if ($entity) { 
    $results = $result->getItemListObject()->getResults();
    if (count($results)) { 
            $i = 0;
            foreach($result->getItems() as $item) { 
                $i++;
                $name = $item->getEntry()->getPartname();
                $img = $item->getEntry()->getPartImg();
                $img_src = ($img) ? $img->getRelativePath() : '';
                $partnum = $item->getEntry()->getPartNum();
                $description = $item->getEntry()->getPartDesc();
                $partcat = $item->getEntry()->getPartCategory();
                ?>


I am using this template to render each entry as it's own tile within a sort and filter interface (see attached screenshot of the results).

For each item, you just need to get the entry attribute. As in my example above, to get an Express entry image attribute that has a handle of "part_img", it would be called like this:
$img = $item->getEntry()->getPartImg();

Notice how part_img becomes PartImg in the above line. Then you'll need to get the src for that image:
$img_src = ($img) ? $img->getRelativePath() : '';

So you'd just need to echo out $img_src.

I hope that helps!
davetl replied on at Permalink Reply
as im just starting to understand the structure. the template or custom template path is correct in what i wrote..
/application/blocks/express_entry_list/templates/detailed_list.php

Is this correct? the path and the name or does'nt the name matter?

thanks

dave
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
The template name doesn't matter. If you're using a theme package, you could also put the custom template there. An example might be:

/packages/my_custom_theme/blocks/express_entry_list/templates/custom_template_name.php

Then when you go to select the custom template, "Custom Template Name" should be an option.

That's how I did it on my project.
davetl replied on at Permalink Reply
thanks.. but a little confusing in the location..
im using cloneametal theme to play and change the elemental theme.
so, i can use more than 1 place for my custom block template then...

/application/blocks/here
/packages/my_custom_theme/here

For correctness.. what is the correct place?

dave
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
I would go with just the custom theme path.

/packages/cloneamental/blocks/express_entry_list/templates/your_template.php
stewblack23 replied on at Permalink Reply
stewblack23
Thanks. This is just what I was looking for.