Inherit Subject script

Does anyone already have a 'inherit Subject script or action (or similar).

I have folders with content like this:

Iron Ships
Company A

If I tag (Subject) the folder 'Iron Ships' with 'Steel Ships', I want all containing items to have the keyword (also images inside Company A folder and the folders themselves'.

(and the same if 1940-45 folder is tagged with 'War')

I would set up some content rules for those folders

Your action could be a tales expression that executes a BrowserView that updates the subjects

Is there en existing 'view' / 'api call' that updates subjects ?

Not that I know of, I would get the subjects of the parent with obj.Subject(),
query the portal catalog with the path of the containing folder to to get the objects
use obj.setSubject() to update the subjects list, and reindex the object obj.reindexObject(idxs=['Subject'])

To get an idea: Search · Subject · GitHub

There is the @@fc-tags browser view which is called when editing tags in pat-structure (Classic folder_contents) ... the module is in ... with the appropriate POST call and parameters this sets or removes tags from the content.

1 Like