Configure the multimedia components to get published inside the website folder
Asked Answered
S

2

7

Need to publish the JS and CSS files using multimedia components. The multimedia components gets published outside the website folder similar to the Images in

“C:\tridion\temp\pub14\Includes\scripts”

Any Idea How to Configure the multimedia components to get published inside the website folder.

We are using IIS to deploy website

Sheeb answered 19/11, 2012 at 11:48 Comment(1)
Do you want every multimedia to this path or only css/js multimedia component?Evangel
C
7

You can overide the path of your multimedia binary using template code as long as you have structure group created for same path.

Ex if you want to publish particular binary to \css\images folder, you first have to create the structure group for same path(\css\images) and use the structure group id in the following code to publish the binary.

engine.AddBinary(Binary.Id, templateID, binaryStructureGroupID, Binary.BinaryContent.GetByteArray(), Binary.FileName);
Carding answered 19/11, 2012 at 13:30 Comment(0)
A
9

You can control this by editing cd_storage_conf.xml. In this file you can configure where binaries go for each publication. For example: you probably have something like this configured: <Item typeMapping="Binary" cached="false" storageId="myStorageId"/> and this myStorageId storage is defined inside the Storages element like:

<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory"
         Id="myStorageId" defaultFilesystem="true" defaultStorage="true">
    <Root Path="c:\temp\" />
</Storage>

If that is the case then you need to change the root path to point to the root of your WebApplication in IIS. More about how to configure the storage you have here (logon required).

Accurate answered 19/11, 2012 at 12:13 Comment(1)
@b00tbu9. Forgot to ask: is this related to Tridion2011 or Tridion2009?Accurate
C
7

You can overide the path of your multimedia binary using template code as long as you have structure group created for same path.

Ex if you want to publish particular binary to \css\images folder, you first have to create the structure group for same path(\css\images) and use the structure group id in the following code to publish the binary.

engine.AddBinary(Binary.Id, templateID, binaryStructureGroupID, Binary.BinaryContent.GetByteArray(), Binary.FileName);
Carding answered 19/11, 2012 at 13:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.