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) { ...


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, ...


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

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

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

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

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

The complete answer will depend on your implementation. Basically whether the parent child relationship is managed through BluePrinting (child websites) or if you are simply talking of related articles which have a ComponentLink field to link the main news to the related news articles? Either way you can use a C# TBB in your page template to read all ...


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

I have received this error when trying upload a DLL that did not have the needed reference DLLs in the GAC. Make sure that all DLLs needed by your namespace exist in the GAC of the server or are registered.


3

The main advantage I can see is that Visual Studio 2013 has native integration with Git and Visual Studio online, which in fact are very robust features for modern software development.


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. ...


3

Seems like you are referring to the wrong version of Tridion.Logging dll (Tridion 2011 instead of the one from Tridion 2013). Please check the Tridion.Logging.dll versions for Tridion 2013 they should be 7.x and for Tridion 2011 they should be 6.x


3

You can prevent localization (in certain Publications) using security: you can set (un)localize permission on Structure Group level. Stopping inheritance/sharing is not possible.


3

We found out that actually this is a bug in system. We contacted SDL customer support and they verified that its indeed so. For example, if folder has dot in its name (.), IsExistingObject will return false even if folder exists. They suggested to us to use encoding the period (.) . with %2E . We did so by creating overload method for HttpUtility.UrlEncode(...


3

The advantage of having it in Razor or DWT is readability of HTML. If you dump it all into a dirty C# TBB, you'll be coding all kinds of escaped strings with HTML - PITA to read/maintain/update IMO. Performance difference will probably be negligible (unless you're publishing hundreds of these components) until you move to DXA that quickly serializes fields ...


3

Looks like you have using vocab = "http://schema.org/", but I'm not sure did you create the specifying semantics on those schemas as mentioned in this document reference Otherwise, you can switch to SDL_CORE or create your own custom vocabularies and prefix. I hope it helps.


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