Change Document Type in Rich Text Schema Field Tridion 2009 - tridion

I am a front end developer who uses Tridion from time to time (on a not very technical level)
.
I am looking for a way to change the document type in the Tridion 2009 rich text schema field to allow me use data-attributes (for a tooltip popover). At the moment the rich text fields are set to be either Strict or Transitional. I need it to be set to HTML5 (I know this can be done in 2011 with some changes. What changes I'm not sure.) As it stands data-attributes are stripped out by default on publish in either of these modes. Selecting HTML5 corrects this issue.
Any help would be greatly appreciated.

The rich text field in 2009 does not allow all this. But you can use a template to transform the field upon publishing. For example: you could take the title attribute on a link and transform it into a data attribute of your choice. I realize it's a bit awkward, but maybe it will do the trick.
You could do this in a C# template or with an XSLT, using the XSLT Mediator.

Could you clarify "front-end" development, please. Are you writing a Tridion GUI or are you writing a web application using content from Trdion?
If the latter, you can certainly transform the RTF content using XPath or XSL before it gets to the app server.
If the former, sounds like an upgrade to 2011 is in order! :-)

Related

Adding hyperlinks to the Description field

I am a user, not a programmer, whose forthcoming new website on Plone 4 requires adding hyperlinks inside the Description field of pages and folders. This is needed to point specific words to our website Dictionary as we had been doing on EZ Publish for the last 10 years.
Our developer says this can't be done in Plone. I'm looking to help them find how to do this (they don't seem to use English-language forums).
Is there an existing add-on or existing code for this? If not, is it possible to code this in? How? If not, will it become standard in Plone 5?
<a href="http://python.org>Python</a> will not work, as the description-field is ment and used as a meta-information of an item, holding plain-text only, and doesn't allow the usage of html-elements, nor embedded Javascript. That's probably why T. K. Nguyen recommends to provide an additional rich-text-field.
But you can use reStrucuredText instead. Tell your developer to exchange the description-snippet in concerned templates to:
<div tal:define="Std modules/Products.PythonScripts/standard;
restructured_text nocall: Std/restructured_text;"
tal:content="structure python: restructured_text(context.Description())">
</div>
It will transform any word starting with 'http:' or 'https:' to a link, furthermore will also recognize mail-addresses like 'someone#plone.org' and transform them to mail-links (on click opens the user's default mail-client, if available, with the address pre-populated in the 'To'-field).
If you want to have named links, use the reStrucutredText-syntax for the input, like this:
`Check out Python`_, you'll love it.
`Write a mail`_ to someone.
.. _Python: http://www.python.org
.. _Write a mail: someone#example.org
The tricky part is to figure out, which templates are affected, but it's doable of my experience (did it with preserving line-breaks in listing-views, not reStructuredText).
Alternatively use a JS-workaround, as proposed by T. K. Nguyen. Be aware though, that it may break accessibility to some users.
It is possible to customize the description fields to be rich text (HTML) instead of plain text, but it requires a developer.
You can also use JavaScript to look at a description field and replace (for example) any string that starts with "http" with a hyperlink pointing to that URL. Your developer would have to look for examples of such JavaScript code and then would have to know how to register it on your site and then invoke it.
This describes how to do something similar, for PloneFormGen field help text (which is also plain text):
https://designinterventionsystems.com/blog/how-to-make-urls-clickable-in-ploneformgen-field-help-text
It might be easier to have your developer create a new rich-text description field and have all your content types include that new field. That, however, would require that you update the view templates for those modified content types. This is much easier with Dexterity, which ships with Plone 5 and is available for use with Plone 4.x.
imho it's a really bad idea to convert the description field to any richttext (html, rst, md) field. You need to change a hole bunch of templates to avoid html code rendered everywhere.
Example:
search
collections
content
portlets
Addons
The description is also often used as title attribute on links, in those cases you need to convert it to plain/text. And there are several more issues, where you could ran into.
As #T. Kim Nguyen wrote: Consider add a new textfield and show it, where necessary, probably implemented as a Viewlet in the below title slot.
Looking at your current site, it seems like you want this to provide a teaser for each article, which may contain links. If that is the case, then you can find other ways to do this without making the description html.
For instance, if you used collective.cover for your portal/collection pages then a Rich Text Tile would allow you to cut down the the object text to an appropriate size, but still edit it with a Rich Text editor, and keep/insert hyperlinks.

Sharepoint 2013 Limit editing to just text

Is there a way to limit content editors on sites to just text? I would like to have them not inject any styles by using inline styling in HTML, or using any buttons in the editor.
I have a few rogue editors that go color and style crazy, and for the next iteration of the public facing site I run, I don't want any chance of that happening.
Thanks all!
There are a couple options I've used in the past - neither is ideal but they may help you.
You can disable features from the rich text editor. Read through this article - it should apply to SP 2013 the same but basically, you can disable color, font, etc from being applied in the RTE.
You can use jquery to remove all styles after the fact. $("#element").removeAttr("style");
I don't think you can accomplish this limitation using a content editor. According to Microsoft, content editor's are designed for HTML so any setting to disable HTML input would be counter intuitive.
http://office.microsoft.com/en-us/windows-sharepoint-services-help/about-the-content-editor-web-part-HA001160897.aspx
"The Content Editor Web Part is intended for adding HTML content to a Web Part Page"
I'm not sure from your post what you are trying to accomplish holistically, or what business need these content editors solve. Could you build a static page/template that fits your need (and maybe even looks like the normal content editor) but utilizes the rich text box feature?
using rich textbox in Sharepoint 2013

how to add the custom elements in the RTF field of a component in SDL Tridion 2011 Sp1

I want to add custom elements in the source of a Rich Text field in SDL Tridion. Is there any chance to add them by changing the XSL filtering in the Schema?
Example:
I have a RTF field "text" in SDL Tridion. I want to add something like this:
<text>
<customelement>the text added through the custom element</customelement>
</text>
Can somebody help me on this?
Thanks.
I'm assuming you're trying to add some HTML5 element in your rich text field.
If you don't want to modify any Tridion installation files, which is something you should try to avoid at all times you could try the following:
Include a CSS class in your rich text field options.
Let the users put the css class on a div, span or anchor tag in your rich text field.
On the front-end with some magic Javascript and jQuery you could try to change the element to the custom element you would like.
Answered previously here
This might introduce issues that are beyond the scope of Tridion support, so you better be ready to support this yourself.
It is probably not necessary to do this. I suspect you should be focussing on your templated output instead.
The standard way for Tridion to store your data in an RTF is as XML in the XHTML namespace. This does not mean that your output needs to comply with this format, any more than the output from a plain text field would need to be plain text.
If you want to have special kinds of data within an RTF field, I would suggest that you use a standard XHTML element, and configure a custom style sheet so that the end users can select the element, and then apply the "specialness" by selecting a class. This is probably a much nicer user experience than having to edit the source tab.
In your templating, you can simply transform these elements into your desired output. I'd suggest using XSLT to do this, or perhaps DOM manipulation, depending on the complexity.

Tool tip (instructions) in Component fields and conditional field values in SDL Tridion components

Is it possible to implement tool tip (instruction) for SDL Tridion component fields using GUI extension? If so, could you please provide the details on how it can be done. The tool tip should appear right next to the field whenever the cursor is placed on the field.
Based on the selected value in one field of SDL Tridion component, can the values in an other field be restricted to specific set of values? For example, country and city fields. When the country is selected, city field should only show the cities of the selected country.
A custom tool tip with instructions for a field
You may consider using custom URLs to accomplish the same functionality. You can provide a separate URL for every field, so you could easily have a "/Extensions/Instructions/Article_Body.html" for one field and ""/Extensions/Instructions/Article_NavTitle.html" for another. That way the user can click the field name to pop up your HTML files with instructions. Although the GUI is different from what you describe, it will require less custom coding.
If you're stuck on the GUI as described in the requirements, I suggest you start by writing your own GUI extension and show us how far you got.
A dependency between fields
As Jeremy said already this is not a default option in Tridion, but can be accomplished (like pretty much anything) in a GUI extension.
This type of requirement has been covered quite extensively already in these questions:
Dynamic drop downs in Tridion designing in schema in SDL Tridion 2011 SP1
how to pass embedded schemas as drop down for the content schema in SDL Tridion 2011 SP1
Check out Can we show a different tooltip when a Dashboard Button is disabled? for the answer to question 1. The default option for question 2 is that it is not possible to do this. A GUI extension could be the answer though.
Custom URL and Description
+1 to Frank on Custom URL. Organization-specific help pages definitely help authors. Though they may not use Custom URLs for this, see a great user guide example from Yale.
Don't forget the description field. This is the easiest way to give authors basic instruction for each field and it shows as a tool tip.
For the text within a field, you can also use default settings. If you're using the inline UI (formerly SiteEdit), consider Content (Component) Types to set default values and instructions.
Category & Keyword (as a tree) for Field Dependencies
Use Categories and Keywords displayed with the "tree" option by setting subcategories (such as country) to abstract keywords. Set selectable keywords (e.g. cities) to normal. Then select the tree option to make it easier to navigate between the options.
If the use case is actually countries and cities, consider offering a better interface than the tree selector or drop-downs.
The catch is only the normal keywords would be saved in the component. However, there are workarounds to getting the keyword path.
Update: Custom Urls are not deprecated, only the old script was deprecated in favor of a new approach in SDL Tridion 2011 SP1.

Access a component's fields from a custom deployer

I'm trying to create a custom deployer in Tridion 2011 SP1 that can index a component to a solr instance once published. Everything is working fine but I've come across a bit of a problem with the way it indexes the components fields.
I can access the meta data fields okay by using the Component.getCustomMeta() method and parsing the XML. Accessing the normal fields however does not seem to be possible without reading in the file that is being output and parsing the output. This is not entirely feasible as the markup may change and it seems to be a long way around doing what should (hopefully) be a simple thing.
I've had a trawl through the docs and there doesn't seem to be anything available to get the field values so am I at a loss here and will need to parse the output or am I missing something somewhere?
Content fields are not exposed as such on the delivery side, content is exposed as, not surprisingly, "content".
If you really need the fields, you need to:
Produce a "parseable" output for your component presentations
Parse the component presentations as they get published.
Look at implementations like DD4T for similar approaches.
In short - you cannot do it, because Tridion does not expose it Out of the Box. The only way to do it is by changing the content output format through a template.
We have done an alternative workaround to achieve for the similar requirement. One down side with the implementation is extra rendering of Component Presentations in XML and duplicate of xml storage in broker.
Here is what we have done:
Created a Dynamic CT (XML representation of content) GetComponentAsXML and mapped to all schemas
All the Page Templates has a C# TBB that looks up the content that we need to push to SOLR
C# TBB does the RenderComponentPresentation with above Dynamic CT GetComponentAsXML, this pushes the XML (engine.RenderComponentPresentation(component.Id, componentTemplateURI)
Deployer now gets the content in xml format, in addition to the other type of component presentations (like ascx, emebedded on page etc..)
Hope this information helps.

Resources