Jump to content
Sign in to follow this  
kongondo

Multiple page select - limit number of selections

Recommended Posts

Hi,

Using a multiple select page field, there is no way to limit the user to select a set maximum number of pages, is there? For instance, force them to select a maximum of 4 pages from a possible 20 pages when using that field? Short of writing the instructions for them in the field's description, is there some other way? Thanks.

Cheers.

/k

Share this post


Link to post
Share on other sites

Write some instructions is the only way I believe. 

In the template file, just "break" the loop or slice your array. When you use repeaters, you'll never use hundreds of them so the overhead is minimum. 

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By cosmicsafari
      Hi all,
      Before I go potentially wasting time trying to achieve the impossible.
      Can anyone confirm if its possible to have a Page Reference field on a modules config page?
      I'm wanting to essentially just output a list of select able pages based on the a given selector (likely by template at this stage), wherein the select is the pages that the module should apply to etc. I was thinking a simple checkbox list would suffice is asmSelect isn't available.
      Essentially have it display the same way a Page Reference field would display on a template, where you can easily select a bunch of them.
      public function getInputfields() { $inputfields = parent::getInputfields(); $f = $this->modules->get('InputfieldPage'); $f->attr('name', 'testSelect'); $f->setAttribute('multiple', 'checkboxes'); $f->setAttribute('findPagesSelector', 'template=development'); $f->label = 'Test'; $inputfields->add($f); return $inputfields; } Figured something akin to the above would work but can't seem to get rid of this warning on the modules config screen though.

×
×
  • Create New...