We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question, Problem

Item List Names

I am sure this is just something simple I am overlooking but I can't seem to track it down. Previously I have made a perch content region and in the admin area checked "allow multiple items". Without thinking about it, the multiple items showed in a list (after choosing to not edit on one page) with the first heading in the template as the list title. I did this again recently but now the list shows "Item 1, Item 2, etc." as the list titles.

Here is the template if it helps:

  <article class="researcher">
      <h1><perch:content id="staffName" label="Full Name" required="true" suppress="true"/></h1>
      <perch:if exists="staffImage"><img src="<perch:content id="staffImage" type="image" label="Staff Image" />" alt="<perch:content id="staffalt" type="text" label="Alt text" />" /></perch:if>
      <h2><perch:content id="staffName" label="Full Name" required="true" /></h2>
      <h3><perch:content id="staffTitle" label="Role" required="true" /></h3>
      <perch:content id="staffBio" type="textarea" label="Bio" markdown="true" editor="simplemde" required="true" />
  </article>
Kevin Sweet

Kevin Sweet 0 points

  • 2 years ago

I think adding title="true" will name the list rather than Item 1, etc. So for example adding it to your staffName will name the list items with the name you enter.

Hi,

You can do this with the title attribute - read more here:

https://docs.grabaperch.com/templates/attributes/title/

So you could implement it like this:

<article class="researcher">
      <h1><perch:content id="staffName" label="Full Name" required="true" suppress="true" title="true"/></h1>
      <perch:if exists="staffImage"><img src="<perch:content id="staffImage" type="image" label="Staff Image" />" alt="<perch:content id="staffalt" type="text" label="Alt text" />" /></perch:if>
      <h2><perch:content id="staffName" label="Full Name" required="true" /></h2>
      <h3><perch:content id="staffTitle" label="Role" required="true" /></h3>
      <perch:content id="staffBio" type="textarea" label="Bio" markdown="true" editor="simplemde" required="true" />
  </article>

Of course. I knew it was simple and something I forgot. Amazing what you can miss. I was comparing it to other code and didn't see anything different but the "title" is different.

Thank you both Wayne and Mike.