In my project we are accessing Tridion to publish the JS and CSS files, but in order to maintain consistency we need to publish all the required files every time. Is there any way to automate this, so that when run all related files in Tridion get published?
In another project we created a schema called 'Site Assets' here all site assets like css icons, stylesheets, js, ico files etc we're embedded into this component.
The scheme was then linked to a dynamic component template that contained the logic to push the items to a specific location (Structure group).
This helped the technical users in the system keep track and published all items in a single go.
From the online documentation (login required):
Customizing the resolving process involves manipulating the list of items to publish that results from a publish action.
I am suggesting the use of a Template Building Block because (in my opinion) is the easiest and least intrusive way of accomplishing it.
Then the challenge would be to identify/define which items should go together within the same publishing transaction, i.e. defining the publishing rule.
Once you figure that out it is a matter of organizing your binaries, for example, you could put them in a folder and publish any of the items in that folder will trigger the publishing of all the items in such folder; you could also have a page where you drop all the binaires as component presentations; you could use a bundle, you could use metadata to associate them, etc...
There you go, Rupesh. You got 6 answers (7, if you include Will's suggestion) so far. Let me give you the 8th :) I hope you're not overwhelmed.
I would go for a combination of event system and structuring your website in Tridion Content Manager.
1) The structure would imply grouping together all your JS/CSS under a common Structure Group. For example, you could have the following:
+ Root + Assets | JS | CSS
2) The event system would intercept the publish of a JS or CSS Page or Component and it would resolve the Structure Group where it belongs to (e.g.
JS). It would then take the parent SG (i.e.
Assets) that is in fact the common SG for all JS and CSS Pages and it would publish that Structure Group.
This would ensure that all JS/CSS would be published together in one transaction. Optionally, you could fail the initial publish action on the JS/CSS individual Page/Component.