We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Limit results of externalaly load ajax page.

Development and Programming

CADAUDIO's avatar
CADAUDIO
13 posts
10 years ago
CADAUDIO's avatar CADAUDIO

According to https://ellislab.com/expressionengine/user-guide/channel/dynamic_parameters.html

dynamic_parameters

I’m using this example on that page:

<form method="post" action="{path='template_group/template_name'}">
  <input type="hidden" name="csrf_token" value="{csrf_token}" />

    <select name="orderby">
        <option value="date">Sort By:</option>
        <option value="date">Date</option>
        <option value="title">Title</option>
        <option value="comment_total">Most Comments</option>
    </select>
    <select name="sort">
        <option value="asc">Order In:</option>
        <option value="asc">Ascending</option>
        <option value="desc">Descending</option>
    </select>
    <select name="category[]">
        <option value="">Result Limit:</option>
        <option value="1">Dogs</option>
        <option value="3">Cats</option>
        <option value="5">Gerbils</option>
    </select>
<!-- Only I want to add this -->

    <select name="category[]">
        <option value="">Result Limit:</option>
        <option value="1">Baseball</option>
        <option value="3">Football</option>
        <option value="5">Golf</option>
    </select>

    <input type="submit" value="Go!">
</form>

Adding this to accept multiple cateogries is not working.

dynamic_parameters="orderby|limit|category[&]"

Do I need to wrap each select in it’s own form?

       
Mike's avatar
Mike
2 posts
10 years ago
Mike's avatar Mike

Hi CADAUDIO,

No, you do not need to put each select into its own form.

A few things of note:

  • Make sure {path='template_group/template_name'} is a valid group/template path and that your channel:entries tags with the dynamic_parameters parameter are in that template

  • Make sure your second category select set has the correct category IDs - they are the same as the first set in the example

  • Note that using category[&] will make the category selection(s) inclusive - see the documentation for [&] usage

If after reviewing these you are still having trouble, post your actual template code and we’ll take a look.

       
CADAUDIO's avatar
CADAUDIO
13 posts
10 years ago
CADAUDIO's avatar CADAUDIO

Thanks Mike,

I will look into this. I ended up using a little jQuery and cookies to define what the end result of the second select url defined and it worked like a charm.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.