I am using tridion 2013, where I need to publish the css images. It's getting published using the below templates(1 & 2) but is appending the tcm id.
Template 1 - I thought using Addbinary would not append the tcmid but it's doing so.
Component mmc = engine.GetObject(package.GetValue("Component.ID")) as Component; engine.PublishingContext.RenderedItem.AddBinary(mmc);
Template 2 -
TcmUri Comp = new TcmUri(package.GetValue("Component.ID")); Item compItem = package.CreateMultimediaItem(Comp); package.PushItem("MultimediaDoc"+compItem.ToString(),compItem);
Now if I need to directly refer that image in the PT/CT like "
images/print.css" instead of reading from the component then it's not appearing since the filename is not matching(in PT it's without tcm id and I can't use it because of environment conflict). Please suggest how to refer it correctly in my page even if it's published with tcm id appended.
UPDATE - I have used the same DFA along with Template 2 code to publish the binary in
2011, it gets published without tcmid, but in 2013 only it's appending tcmid.
engine.PublishingContext.RenderedItem.AddBinary()function will do it for you, Please refer TOM.NET API document for more details and overloaded methods for it.