# Expand/collapse URL parameter

**URL:** <https://farmos.discourse.group/t/expand-collapse-url-parameter/1344>\
**Category:** Using farmOS\
**Tags:** support-request\
**Created:** [September 7, 2022, 9:39am UTC](https://farmos.discourse.group/t/expand-collapse-url-parameter/1344 "2022-09-07T09:39:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [September 7, 2022, 9:39am UTC](https://farmos.discourse.group/t/expand-collapse-url-parameter/1344/1 "2022-09-07T09:39:00Z")

</div>

Hi there

@mstenta Is it possible to affect the behaviour of the location tree from the URL?  
I think it makes more sens to have it expanded. (Actually a long term solution could be to remember the state from time to time)

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [September 7, 2022, 11:10am UTC](https://farmos.discourse.group/t/expand-collapse-url-parameter/1344/2 "2022-09-07T11:10:21Z")

</div>

Expanding by default sounds good to me. Remembering the state would be even better, but of course more complicated.

If you (or anyone) want to experiment and make a pull request, here is the relevant code:

> <https://github.com/farmOS/farmOS/blob/b495cdb840bd0bc662c1c57205ebcec8f1fe85bf/modules/core/ui/location/js/locations_drag_and_drop.js#L23>

It uses the Inspire Tree library: [GitHub - helion3/inspire-tree: Inspired Javascript Tree](https://github.com/helion3/inspire-tree)

Sounds like initial tree state can be configured in different ways: [GitHub - helion3/inspire-tree: Inspired Javascript Tree](https://github.com/helion3/inspire-tree#node-configuration)

---

<div class="post-metadata">

**Author:** ![paul121](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@paul121](https://farmos.discourse.group/u/paul121)\
**Post date:** [September 8, 2022, 6:19pm UTC](https://farmos.discourse.group/t/expand-collapse-url-parameter/1344/3 "2022-09-08T18:19:19Z")

</div>

> Expanding by default sounds good to me.

I have _a feeling_ this wouldn’t work well for Rothamsted, they tend to have lots of locations 🙂

But I do like this idea… lets make it configurable!!! 😃

---

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [September 8, 2022, 6:35pm UTC](https://farmos.discourse.group/t/expand-collapse-url-parameter/1344/4 "2022-09-08T18:35:29Z")

</div>

> [@paul121](#):
>
> But I do like this idea… lets make it configurable!!! 😃

Configurable and a simple, focused searchbar.  
😇
