Hot answers tagged

13

I - like most other Tridion implementers, I'm sure - have also been confronted with this very important decision, and my conclusion has always been that It doesn't matter as long as it is consistent Often the challenges I've seen are more around semantics than actual grammar - making sure your "displayHeadline" field is always called "displayHeadline" on ...


9

I think it's something you agree as a team. At Building Blocks we tend to use underscored names for XML names e.g some_field. I don't think there's a "right" way of naming, as long as it's consistent throughout the implementation (and valid XML!)


8

OK - I'm going to pitch in with the same damn answer.... It doesn't matter as long as it's consistent ... but I'd like to add If you don't make it easy to type from memory, you will hate yourself.


7

I agreed completely with Nuno's answer above, but wanted to add my two cents. The rule of: It doesn't matter as long as it is consistent Is really important to me as I use it when writing my templates. I'm able to know the naming rules of the schema field so that I can really pump out dwt without having to keep checking the names of the schema / ...


6

Yes, the function is available if you are on Tridion 2013 or later version of Tridion. The function is SynchronizeWithSchemaAndUpdate. There is one nice article by Eric for using this functionality from core service: Synchronize components If you are using 2011 then there should be power tools for it, details are given here: Synchronize Component in ...


6

You can start by using HttpUtility.URLEncode Here you have a nice start list of percent encoded characters, although the RFC (3986) is definite. Also bear in mind that there are a few characters which can't be parsed (the forward slash one) unless you do a whole lot of hacking. Others ( * : % & ) require a fix that Microsoft brought out.


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

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


5

Your question/problem is not specific to Tridion, but a general question on how to deserialize XML mixed content using the XmlSerializer. Note that the content of a "rich text field" (a.k.a. XHTML field) is mixed content in XML. That is: it is text content mixed with XML elements from the XHTML namespace. You currently map the "Body" field to a property of ...


5

SDL Tridion Schemas can be divided in two categories, a Tridion Web Schema and a W3C Schema. The first variant (also known as a Simple Schema) does not allow attributes and only accepts certain data types. The second variant (also known as Complex Schema) will allow you anything supported by http://www.w3.org/2001/XMLSchema. But W3C Schemas don't have a ...


5

"Simple Schemas" don't support attributes, only elements. You can modify the Source tab of the Schema to add the attribute, but be aware that it will change it to a "Complex Schema" - meaning you will not be able to use the form-based UI to edit Components based on said Schema. You will only be able to edit it in the Source tab or through the API.


5

You can probably try to work with various rules for what needs to be encoded, and indeed some of us would probably enjoy learning about all the exceptions and edge-cases. For practical work, however, you are much better off using Tridion to find the WebDavURL of an item. If you have the Power Tools loaded, you can simply copy/paste the webdav url from the ...


5

I am in agreement with Nuno and also with Dominic. Generally if you go with naming conventions, Pascal cases are generally specified for methods and camel cases for local variables in a programming methodology (Microsoft). In XML there is no such specified naming convention, though most of the professional recommend using lower case or camel case. In my ...


4

RFC 1738 Uniform Resource Locators lists characters which are regarded as unsafe in any URL. These must always be escaped. Beyond that, specific schemes may have additional characters that need to be escaped. A more recent standard: RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax gives more details of various character sets. You could say that ...


4

Escaping would be a way as @user978511 suggests, but RSS feeds are valid XML, so you can simply keep the tridion:href attribute in your links as long as you add the appropriate namespace to your XML. The correct namespace for the tridion prefix would be http://www.tridion.com/ContentManager/5.0, you can add that to the rss root element of your feed XML: &...


3

The easiest way is to apply XSLT transformation to it. You can google a bit and find something like: https://stackoverflow.com/questions/1162352/converting-xml-to-escaped-text-in-xslt https://stackoverflow.com/questions/12773334/html-escape-some-xml-tag-using-xslt Just pick the most appropriate


3

If you mean how to determine the field type: it is reflected in the type of your loopVariable (which is a pretty lousy name for a variable, BTW :-) Note that ItemFieldDefinitionData Is an abstract base class. The actual instances will be of a concrete subtype which reflects the field type.


3

Look at the Content Delivery Web Service, it is a REST endpoint based on oData, which allows you to query Component Presentations, Pages and more from the Broker DB via web service calls. CD Web Service API Documentation If your DCPs or Pages contain XML, then you can retrieve that and parse it or load it in your jquery datatable. Here is an example query ...


3

When you retrieve the path for a folder, Tridion looks this up in the path_mappings table in the database. Of course, it could construct the path every time by walking through the folder hierarchy, but this is less efficient. Of course, this means that the path_mappings table needs to be maintained every time a folder is changed, or moved, or localized, etc. ...


2

I resolved this by simply moving the folder to another Dummy Folder and moved back. I got the path back. Do not know the reason why it happened.


2

I don't recognise Convert-To-Xml as a standard Powershell function, although maybe it's in a module you are using. In any case, to get the content into an XML document all you need to do is: $xDoc = [xml]$tridionItem.Content If Convert-To-Xml isn't working, Select-Xml will silently return null - you can test this simply like this: PS C:\Users\...


2

Not much options. If you are using tcm items then i'd say Object.serialize($model.getItem("tcm:0-1-1").getXmlDocument()) -> send for manipulation -> $tcm.getItemFromXml(Object.deserialize(result).xml) But I can assume, you won't be able to serialize XML documents due to its size.


2

You will need to reach out directly to SDL Support. As of Jan 1st 2020, SDL Tridion 2013 SP1 HR1 entered in the "extended support phase" as per the notification at https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-sites/b/product-announcements/posts/sdl-tridion-2013-sp1-hr1-standard-support-extended-to-december-31-2019. I'm not sure if SDL ...


2

tidy.Options.WrapLen this resolved my problem


2

There is no JavaScript or JQuery API available for the Content Delivery side, you can access this server side with either Java or .NET using the documented APIs, read all about it here. Going directly to the database is also not advised, since the data model of the content delivery is not open, meaning that its data structure can change without notification ...


2

As the component content is inside an xml itself, the text is going to be "escaped", so you need something to unescape the content. So the xml is going to be published full of "& lt;" and "& gt;" characters. What we usually use is a C# Fragment to unscape such characters. Something like this: Item salida = package.GetByName(Package.OutputName); ...


1

I agree with your approach of using the Core Service to get the IDs of all of the Components on the localised versions of the Page. However, if you're just storing the IDs of the Components on the Pages, then I'd be tempted to do this (and the comparison to the US version) in objects in your application code and then write this out to the screen, rather ...


1

Using RegEx to parse XML will probably drive you insane. Here's a somewhat rushed way to parse your XML... string xml = "<FaqCategory xmlns=\"http://www.xyz.com/tridion/schemas\"><Title>Denied boarding compensation options</Title><url>Denied boarding compensation options</url><List xmlns:xlink=\"http://www.w3.org/1999/xlink\...


1

In the "old" days when I used to update components using the TOM API I would use the UpdateXML() call to update the entire Tridion XML of the item in question. My guess is you got into this mess by switching only the schema (thus leaving the content intact) and ended up with an invalid combination of both (this is most likely the reason why the WebGUI doesn'...


1

Take a look at the code in Dom's Component Synchronizer here for some ideas on how to fix the XML: https://code.google.com/p/tridion-2011-power-tools/wiki/ComponentSynchronizer You can also try installing the legacy Component Synchronizer Powertool and see if that fixes the XML. You can find it here: http://sdltridionworld.com/community/extension_overview/...


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