How do I specify what media folder is selected on an image editor?
Hi! I'm not as well-versed on how grid editors work, but I have an assignment that's going to give me an opportunity to learn more.
Currently, when we click on an image grid editor, we get a "Select media" interface that begins at the root of our Media section. We have one grid editor, however, that seems to open in a different specific location every time. I'm not sure what customization might have been added before I arrived.
If I choose image here:
I get the interface here:
I just tried this very same test page on my coworker's machine and she gets the root of the Media section. When I look in my cookies back on my machine, I see I have a cookie called "umbLastOpenedMediaNodeId" with a value of the ID of this media node. However, when I search in the Umbraco solution in Visual Studio, I don't see this. Does anyone know where this cookie is created and read?
How does Umbraco determine what part of the Media section to start on when an image editor is chosen? Where can I find this answer in the code of Umbraco?
The media pickers remember the location that was last viewed for that editor. This is really helpful when doing a lot of media picking from the back office. I think it could be made even more useful but that wasn't your question!
We're actually on v7. I don't have a mediapicker.controller.js, but I do have a cdnmediapicker.controller.js. I do, however, have "umbLastOpenedMediaNodeId" in umbraco.controllers.js. Again, I'm not sure what is out of the box and what was added as a customization before I started on it.
I just need to learn more about how this works. Sometimes I see it work as expected and sometimes the cookie never updates and the picker always opens to the same location (which is usually the top of the media nodes).
It's hard to search the v7 repo in github now that the master version is v8. If you need to look to see how this is set I'd advise to download the source and try and search locally for that cookie.
How do I specify what media folder is selected on an image editor?
Hi! I'm not as well-versed on how grid editors work, but I have an assignment that's going to give me an opportunity to learn more.
Currently, when we click on an image grid editor, we get a "Select media" interface that begins at the root of our Media section. We have one grid editor, however, that seems to open in a different specific location every time. I'm not sure what customization might have been added before I arrived.
If I choose image here:
I get the interface here:
I just tried this very same test page on my coworker's machine and she gets the root of the Media section. When I look in my cookies back on my machine, I see I have a cookie called "umbLastOpenedMediaNodeId" with a value of the ID of this media node. However, when I search in the Umbraco solution in Visual Studio, I don't see this. Does anyone know where this cookie is created and read?
How does Umbraco determine what part of the Media section to start on when an image editor is chosen? Where can I find this answer in the code of Umbraco?
Thanks!
Jeremy
Hi Jeremy,
The media pickers remember the location that was last viewed for that editor. This is really helpful when doing a lot of media picking from the back office. I think it could be made even more useful but that wasn't your question!
There are probably other locations but the general logic within the Umbraco core (v8 and infinite editing) is https://github.com/umbraco/Umbraco-CMS/blob/4733256ca1bfb49d4fe946110e734db1351f81d9/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js#L24
HTH, David
Hey, David.
We're actually on v7. I don't have a mediapicker.controller.js, but I do have a cdnmediapicker.controller.js. I do, however, have "umbLastOpenedMediaNodeId" in umbraco.controllers.js. Again, I'm not sure what is out of the box and what was added as a customization before I started on it.
I just need to learn more about how this works. Sometimes I see it work as expected and sometimes the cookie never updates and the picker always opens to the same location (which is usually the top of the media nodes).
Hi Jeremy,
It's hard to search the v7 repo in github now that the master version is v8. If you need to look to see how this is set I'd advise to download the source and try and search locally for that cookie.
The v7 grid media controller can be found here https://github.com/umbraco/Umbraco-CMS/blob/89c376f77a5f4b5f738916b265bf288e16ba0549/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js#L7
Then it's a matter of tracing back through the service calls to find the start node being fetched from the User.
I think this is working as designed though (opens from the last place you visited), so I'm not sure what more to suggest?
Many thanks, David
is working on a reply...