Hiding assets in the asset finder


(Gjboyd7) #1

Hi

 

Is there a way to hide folders in the asset finder in Easy Edit Suite.  We do not want to confuse our editors by showing them the complete site files in the asset finder, just a couple of folders that they need.

 

Thanks,

Gavin


(Anthony Barnes) #2

EES doesn't have a config option to support that, but you would be able to achieve it by using a javascript plugin. I believe the main reason we didn't add this is that hiding assets can generally be controlled with permissions in most cases (removing read access from the folder, but not it's children). The other reason is that hiding items would further complicate the pagination code and could have unintended consequences with multiple linked assets.


(Scott Hall) #3

Hey Gavin

 

Have a look at the config file property called "assetFinderLocations" - see http://manuals.matrix.squizsuite.net/ees/chapters/asset-finder#Customisable-Root-Nodes and  http://manuals.matrix.squizsuite.net/ees/chapters/installation#Constructing-the-Configuration-File

 

What you could do (to make it easy on yourself) is add the locations that are used for hotzone activity (like news and/or events) and then educate the users to go to those areas directly after opening the asset finder. Also, another way to avoid having to navigate too much with the finder would be to educate users to find the areas they work in the most, by just navigating the site like a site visitor would, then apply /_edit to the page. Which will mean they will immediately be within context of where they want to work.

 

Once you start hiding asset finder asset with CSS or JS you run the risk of it being near impossible to troubleshoot support issues. For example, if the user opens the asset finder 10 levels deep but a couple of it's parents are hidden with CSS or JS it could break the way it works and/or looks.

 

Cheers

 

Scotty


(Tim Davison) #4

We do this using a javascript plugin for EES.  It’s the most elegant way I could achieve it:

  • Set up a config for your plugin that allows you to specify the locations to hide by asset ID (to make it easier to change down the road).
  • When the asset finder loads, generate CSS styles based on the config you supplied.
  • Dynamically append a new style element with your rules to the head.
Some things to watch out for:
  • This will also affect the child count which is beside the parent asset in the asset finder (we also use the plugin to override this where we need to).
  • If you want a location the left-most column but not in the other columns, you need to define a double-set of CSS.  The basic one to hide it, and then another one to make sure it shows in the left-most column.
  • Borders will collapse in the asset finder.  Need to override the default EES CSS so the borders are removed from the outer <li> elements and applied to the child <a> instead.  Then the borders will be hidden as well.
Update:
Scott’s point about support issues is very valid.  If you use a javascript plugin, make sure you (a) have an easy way to turn the plugin off and on (don’t lump it in with the Squiz nested code), and (b ) have a staging area that very closely matches your live version.  Then, when a bug occurs (because they will), in your staging turn off the plugin and confirm whether it’s Matrix/EES or something you’re doing.