Create the Project Thumbnail Custom Attribute

Now that we have our Project Category custom attribute, let’s create a the thumbnail image attribute that will be used in our Project Grid block type.

Again, we could use the image that we place on our project page for this piece of data, but in general it’s best to use attributes for something like this? Why? Just because a page has an image at the top doesn’t mean it always will. What happens if an editor wants to place an image slider at the top of a project page instead of an image? With a separate image attribute they’ll be able to have that flexibility.

Copy the Core Thumbnail Attribute

The Elemental Full sample content installs an attribute with the handle thumbnail; let’s use this as our starting point. Open concrete/config/install/packages/elemental_full/content.xml and find the thumbnail page attribute:

Copy this into attribute.xml and change the handle and names, and set the package properly:

Make sure the project_thumbnail attribute is in the same Dreamrs attribute set that we added Project Type to:

Upgrade the Package

Now, let’s upgrade the package to install our attribute. Increment the $pkgVersion property in the controller.php file to 0.6.6. Then, upgrade the package from the command line

And our thumbnail exists and is in the attribute set: