Forum

Thread tagged as: Question, Problem, Installation

Pagelist field type isn't displaying a selection dropdown menu?

Hi,

I've added the pagelist addon as I wish for my clients to be able to select the page they wish to link to.

Being new to Perch, I may have made an error installing, but, as far as I am aware, I just need to add the pagelist folder (and the contents of) to the plugins folder.

My content html file has the following code:

<div class="sidebar-btn">
  <a href="<perch:content id="page" type="pagelist" label="Page" output="navtext" help="Please select the page you wish to link to" required="true"" class="button event-btn"><perch:content id="button" type="text" label="Button text" help="e.g See More" required="true"/></a>
</div>

However, the page element provides a page field, rather than a selection field like I was expecting.

screenshot of error

Grant Smith

Grant Smith 0 points

  • 3 years ago

It looks like there is an error with your code. You are missing a closing /> on the first perch:content

Try this

<a href="<perch:content id="page" type="pagelist" label="Page" output="navtext" help="Please select the page you wish to link to" required="true" />" class="button event-btn"><perch:content id="button" type="text" label="Button text" help="e.g See More" required="true"/></a>

And, you don't need output="navtext" here because you want the href value to be the page URL

Hi,

Thanks for this, I agree the /> is missing, and is now corrected. However, this doesn't resolve the issue. There still is not a drop-down list of pages?

Is the pagelist folder in perch/addons/fieldtypes? You mention 'plugins folder' in your original post, that's not the correct location.

Bingo! Thank you, exactly that! I couldn't find any documentation on the add-on and hence guessed it just belonged in the plugins folder. Thanks again

https://docs.grabaperch.com/api/field-types/

To use the field type open perch/addons/fieldtypes and put the folder filelist containing filelist.class.php into it. You can then use it like any other field type by specifying type="filelist" on a template tag.