Adding additional Metadata field in AEM-DAM - adobe

I want to add a custom metadata field in DAM assets, is there any way to add custom metadata apart from overlaying a workflow or writing custom workflow?

Metadata profiles is the way to add default properties to assets on upload. Metadata profiles are linked to assets at folder level. You could have different default properties for assets based on folder they are uploaded to. For e.g. attached default tags based on folder
Checkout this link for the detailed documentation on how to add metadata profile to a DAM folder
Metadata Profiles

Related

AEM Metadata Schema Editor Form doesn't show Asset Rating field

I'm creating new fields to customize the Assets Metadata Schema, however, there is a field missing: Asset Rating. Looking into the web I've figured out that is disabled on .jsp configuration file, so, I've enabled that (uncommenting) directly in CRX repository. However, after trying this approach the field keeps missing on the form
Obs.: I don't what means that comment
<!-- CQ-4284633 Disable ratings component in metaschema editor when skyline is enabled -->.
Are you using AEM as a Cloud Service? If so, the Asset Ratings widget is not supported in the schema editor.
From the feature parity section of the AEM Assets Cloud notable changes.

Fields that are imported via config are disabled by default. How to enable them?

In a custom module for Drupal 8 I'm able to add a new content type with all of its fields, but all of the fields are disabled by default. How do I enable them during install of my module?
Edit To be clear, module fields are not being enabled by default under Manage Form Display. How do I enable (or disable) fields using something like hook install?
Edit 2 Along with enabling fields by default in a newly created content type, installing this module also updates fields on an existing content type (Article) and those fields are also disabled.
Edit 3 disabled meaning they are shown as disabled on the form display for the content type and users cannot see the fields when adding content.
There must be code that I can run via hook_install that enabled fields on a content type?
I'm presuming that by "disabled" you mean that the fields aren't displayed when an instance of your content type is made.
Personally I've been using the UI to set up how each of my fields are displayed through the "Manage Display" page provided for each content type. I drag the fields that I want to enable from the disabled section as you would normally.
When I'm happy with how the fields are arranged I then use the brilliant inbuilt export functionality (think features in Drupal 7 but way better) to generate the .yml config files for my content type.
This process is described brilliantly by this article on the Drupal website. In this case, as it's just the config for which fields that we want to display, it should be as simple as exporting the "Entity View Display" config for the content type to a .yml file. (note that you need to name your yml files correctly, this is explained in the article (and I think that the export module provides the auto-generated name anyway)).
Here is what the export looks like for one of my content types:
Once I've generated the config files that I want to apply to Drupal when the module is enabled it really is as simple as making two directories in the root directory of the module:
"./config/install"
and placing the config files into the install directory.
Now, when the module is first installed Drupal will apply the configuration provided by the files in the /config/install directory.
This process is elaborated upon here: https://www.drupal.org/docs/8/creating-custom-modules/include-default-configuration-in-your-drupal-8-module
When you export a field you have to export too:
"Field declaration" field.field.[entity_type].[bundle].[field_name].yml file. Don't forget to add re-used fields declaration
"Field Storage" field.storage.[entity_type].[field_name].yml file
"Form Display" where you have modified the field configuration. core.entity_form_display.[entity_type].[budle].default.yml
"Manage Display" where you have modified the field configuration. core.entity_view_display.[entity_type].[budle].[view_mode_id].yml files (If you have Default, Teaser, etc)
"Entity", if the entity is new. [entity_type].[type|paragraph_type|vocabulary].[bundle].yml file
I recommend you to use "drush cex/cim" commands to import and export configuration.
I don't know too much about Drupal 8 but when i try to create custom content type to use this article.
https://www.drupal.org/docs/8/api/entity-api/creating-a-custom-content-type-in-drupal-8
Then when i enable our custom module then content type is created successfully and the content type fields are also enabled.
Also i have try to create a node in this content type then the node is successfully created.
So please check this article.
It may be helpful for you.
Thanks,

Upload Multiple Assets to an Entity

On documentation it is said that Only 1 asset can be attached to an entity. Is there any way to attach multiple images to an entity?
Currently this is not possible. You can work around the limitation by using folders, and connecting them to a user or other entity:
Linking a folder to an asset
In order to access the asset for the image in the folder, you need to link the folder to the asset. You can do that by issuing a POST request in the following format:
POST /{org-uuid}/{app-uuid}/folders/{folder-uuid}/assets/{assets_id}
where {folder-uuid} is the UUID of the folder, and {assets-uuid} is the UUID of the assets entity.
Here’s how you could link the folder and the asset you created for the my-image.jpg image:
POST https://api.usergrid.com/my-org/my-app/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets/9501cda1-2d21-11e2-b4c6-02e81ac5a17b

Drupal6: I need to customize file upload links in node edit form

I am customizing the node/add and node/edit forms of a content type with a form_alter. In my content type, there is a file field that permits to upload files to the content.
What I would like to do is to customize the file box by changing the link to the file that is composed at runtime with Ajax. How can I do it without modifying Drupal core?
Your Private Files directory should not be in the docroot. Hiding it with a .htaccess rule will not work, as you point out in a comment.
Say you have Drupal in /var/www/sites/example.com/, then you should not store your private files under that directory; /var/www/sites/example.com/sites/default/private/files/ is just plain wrong.
You should, instead store the files where apache will not serve them, but can read them. E.g. in /var/www/files/example.com/. Then change the setting in Drupal to use that absolute path.
If you are running a large(r) site, you will probably want to store your files on a dedicated mount (drive, NFS etc.), say /media/nfs-example-com/.
Try Filefield Paths:
The FileField Paths module extends the default functionality of Drupals core Upload module, the FileField module and many other File Upload modules by adding the ability to use node tokens in destination paths and filenames.
http://drupal.org/project/filefield_paths

How to store Blobs in Drupal?

I want to store PDF and Image files in Drupal. By default Drupal seems to store binary/uploaded files into the filesystem. I want to to be able to store files so that - I can have workflows, metadata, IP information and URL aliases?
Update, am still stuck at how to create URL aliases for files on the file system. Drupal only seems to allow creating URL aliases to node content.
The simplest solution for Drupal is to use the Upload module, which is in core. The upload module allows you attach files to nodes. As you note, they are stored in the filesystem.
If you want to get more complex, you can build your own content types through the web interface by using the CCK family of modules (such as the filefield module or the imagefield module). Your files are still stored on the filesystem.
You could use CCK to create the metadata field you want.
You could use the workflow or rules modules to implement workflow.
IP information is recorded automatically by Drupal's logging module (either the database logging module, which logs to the database, or the syslog module, which logs to syslog).
URL aliases for nodes are available in core Drupal by enabling the path module (or download the pathauto module for automatic creation of aliases).
I tried Drupal's Upload module, FileField as well as uploading files using FCKEditor - I prefer the last one - it is closer to my specific scenario.
Creating an alias to the file will likely require some custom code.
It's not possible to simply create an alias using the Administer > Site building > URL aliases screen. I tried inserting a record with
insert into url_alias (src, dst) values ('sites/default/files/ChipotleArt.JPG', 'here-is-the-file.jpg');
That still didn't work. So, you will really likely need to write some custom code.

Resources