Hot answers tagged

10

In an Assembly Template Building Block you can determine the RenderMode and PublishingContext via the engine. But before checking what Publication Target the current item is being published to, you need to know if you are actually being published, or if the render action of the Template is just a preview. if (engine.RenderMode == RenderMode.Publish) { ...


10

You have not impersonated the Core service client call with your Identity. As per my experience, I won't suggest to use administrator access to impersonate and do processing the request. Example: SessionAwareCoreServiceClient ProxyClient = new SessionAwareCoreServiceClient("wsHttp_2011"); ProxyClient.Impersonate(HttpContext.Current.User.Identity.Name);


8

Welcome to the wonderful world of Tridion... Get ready to go through this cycle a few times in the coming months. Here's a couple of examples to achieve some of what you're searching for - but not all. Tridion does not store the information you're searching for in the CM, it's only available in Content Delivery - unless you want to do some date comparisons. ...


7

I would advise against publishing code from Tridion (although it's possible) and instead put all your code in assemblies and deploy them with the application. In your ASCX Dynamic Component Presentation you would then reference the type that represents your code behind. Since you mention a Tridion ASCX control, it means you are thinking of Dynamic CTs, ...


7

OData is a self-descriptive service, meaning that if you look at http://blah.net/odata.svc/ you will see a list of entities that the service will return: The collection of entities you're interested in is the last one in the list above, i.e. 'Templates'. I think this is the query you're looking for: http://blah.net/odata.svc/Templates(PublicationId=18,...


6

As Peter mentioned in his comments that your question is unclear. But if I consider your last comment which says its a "Object Reference" error, So I think it would be best to check the Objects Variables if those are NULL (a normal C# programming practice) before using them. so please check objects like currentComponent, linkComponentFields , ...


6

I'd cover all bases and check if the schema field exists (what if someone renames this later or you decide to allow another schema that only has some of the currently covered fields)... linkComponentFields.Component("linked_component") exists and then ensure that linkComponentFields.Component("linked_component").Id has a value. var xmlLink = string....


6

Are you escaping your WebDAV URLs correctly? Try loading your folder by ID and checking it's locationInfo.WebDavUrl property to make sure you are. e.g: //created a test folder named "testfolderwith/slashesand.dots" var folder = (FolderData)client.Read("tcm:233-49109-2", new ReadOptions { LoadFlags = LoadFlags.WebDavUrls }); var webDavUrl = folder....


5

First of all you should decide which is the best technical approach for your requirement. I understand from your question that you just need to show a Drop Down List so I will assume that you just need to add a <asp:DropDownList></asp:DropDownList> entry in your page, then you need to consider 2 things. Is this Drop Down going to be available ...


5

This will get you the item CoreServiceClient.Read("tcm:xx-xxx-xx", new ReadOptions()) If you expect a certain item type you can get the item specific data var page = (PageData) CoreServiceClient.Read("tcm:xx-xxx-xx", new ReadOptions()) Getting the version The version will be something like var item = CoreServiceClient.Read("tcm:xx-xxx-xx", new ...


5

I'm not sure the "field builder" approach was available before SDL Tridion 2011. Consider adding an option to select items by copying an example from PowerTools, otherwise a Custom URL or GUI Extension are other ways to change the component editing form itself. Selection in a 2009 Extension The R5.2/5.3/2009 PowerTools has examples for selecting items. For ...


5

Is there something in the SDL Tridion RTF field that you don't like, or do you have an external application that you are using to update the components? It's possible to extend the CKE with your own functionality (see here). I suspect it wouldn't be too difficult to integrate the Item selector power tool (From the SDL World site) into the CKE. Update: I ...


5

The schema has (at least) one mandatory field named "Configuration", and your code is not setting any field values, so the content fails XML validation. You need to add content to your componentData.Content and make sure it's valid according to schema before you can save it. Check if publicationData.Content includes the "Configuration" field?


5

Other than V2012 being a superior product to VS2010 enabling the developer to be more effective, there is no advantage specific to Tridion TOM.NET-related or Content Delivery-related development.


5

As Rick mentioned in his comment, it might be that what your trying to achieve is not possible within a single call due to limitations of the system. If that is the case, you will have to do the recursion yourself. I suggest you try and dig up whether such limitation is mentioned in the API (.chm file). I personally have also ran into some limitations with ...


4

Rather than building the component manually, a more robust approach is to request the default information from Tridion using client.GetDefaultData(ITEM_TYPE, CONTAINER_TCM_ID); This is create the component based on the container, populating all mandatory fields with the default values. So in your case something like var publicationData = client.Read("...


4

On Tridion 2009 you should use the TOM Interop APIs (COM) which are provided under Tridion\bin\Client\PIA. You'll need to use the Tridion.Interop.TDS.dll and Tridion.Interop.TDSDefines.dll. Create a new Tridion session with code like this: TDSE tdse = new TDSE(); If the current Windows user is a valid Tridion user, then it will just work. If it's not it's ...


4

Dominic Cronin, Quirijn Slings, and Andrey Marchuk developed a Tridion Template Testing framework called T-Cubed that may be of some assistance: https://github.com/DominicCronin/T-cubed It's mainly for unit testing templates - so it may not be super helpful for C# that's using TOM.NET, but it's a place to start.


4

Have you seen the GetComponentTemplateUris TBB in this open source set of TBBs on SDL Tridion World - if not, that will probably help you.


4

You could also create a Tridion Custom Deployer and then 'publish' the content from Tridion into IBM WCM. The advantage of this approach is that you can use the Tridion Deployer Java APIs and also your favorite Java IDE and ceremony. The format of the data will be what the Tridion template produces. So, for example, if your Tridion template produced XML (...


4

Let me use an explicit but hypothetical example to add an answer. It looks like a "Parent" is a News Topic or event of sorts, which can have individual News Stories. For example: /News/Weather/Default.aspx /News/Weather/SanDiegoRain/Default.aspx So the requirement is to know or maybe render something related to "Weather" while on the "San Diego Rain" page? ...


4

The KeywordField is the field itself, not the chosen Keyword. You need to get it's value... something like this: ItemFields fields = new ItemFields(component.Metadata, component.MetadataSchema); KeywordField keywordField = (KeywordField)fields[fieldName]; Keyword keyword = (Keyword)keywordField.Value; return keyword.Title;


4

I'm going to answer off-topic, at least to give some context here. Like David and Rick said, the answer is "no." But similar to the "favor composition over inheritance" object-oriented design pattern (from how I understand about it in comparison to Blueprinting), it is probably best to apply localization sparingly. Community member Manuel Garrido even ...


4

The key here is that, while for regular fields, the Value (or Values) property will give you the value of the field, but for embedded schema fields, you should use the SubFields property. This will give you one or more field objects containing the fields inside the embedded schema. Your code would become something like this (it could use some extra null-...


4

In general all objects having any interaction with unmanaged resources should be disposed. With the CoreServiceClient (CS client) it's obvious and easy to do (see Tridion 2013 SP1 Core service timeout with frequent requests), however with the TopologyManagerClient (TP client) it's not that straightforward. One difference is that the CS client is a "pure" WCF ...


4

Let me clarify to help you with this. SDL Tridion Docs comes in different WCF endpoints for different services. Here is the list of WCF services available and Web Services classes and methods refer to the SDL documentation it provided web service each methods request and response XMLs detail, to start with you are already found the document for "using ....


3

You can get the location that binaries are published to by default from Publication.MultimediaUrl. You will need to do a bit more work to detect if binaries have been updated since the last time they were published however. You will need to check different targets depending on whether you are publishing to staging or live, so will need to have some ...


3

Since you are on version 2009 your options are a bit limited, you would either use the Business Connector (SOAP) API, or the TOM API directly on the server. For the TOM API you could write a ASP Page, or you can do an ASPX Page (with C#), but then you have to use the TOM Interop, and run it from the Custom Pages. I don't think I have any direct examples of ...


3

It's a bit unclear from you question, but I think I somewhat understand what you are looking to do (or I'm way off and totally jumped the gun). I'm going to make some assumptions here in hopes that it clears up what you are looking for. You have a component, Component A, which has repeated Key / Value pair fields. We'll assume that the name of the field ...


3

The text below is OK - but irrelevant to the actual question. To read the parameter of a TBB, simply use this: string value = package.GetValue("FieldName"); Where "FieldName" is the (XML) name of the field of the parameter schema. This is relatively simple to do... You need to first load an instance of the EmbeddedSchemaField, then read it's child nodes. ...


Only top voted, non community-wiki answers of a minimum length are eligible