SDL Tridion Schema Field "List of Links" Options - tridion

I'm looking to create an SDL Tridion schema with a list of repeatable links while avoiding multiple fields per link.
Hyperlink
In a rich text field I have the following options for creating a hyperlink:*
Component
Anchor
http://
mailto:
Other
When content authors create one of these hyperlinks, they have the option to select linked (visible) text as well as title and target attributes that function like typical HTML hyperlinks.
"Richtext" means a Text field with Height of the Text Area = at least 2 rows with Allow Rich Text Formatting selected.
Single Schema Field Link
When creating a single schema field, I see these options:
External Link (author options will include http://, mailto, Other)
Multimedia Link
Component Link (which can allow Multimedia Values)
Current Ideas
The best out-of-the-box (OOTB) setups I've found for this "list of links" is either offering:
a single 2-line RTF with instructions to create a hyperlink (of any type) in that field
separate fields for each type as well as additional fields for display name, target, and title (where the fields are assembled through template code), authors fill in only one of the fields (component link or external)
Question
Is there a way in the schema form designer, by updating the schema source, or through code to offer the same (RTF) hyperlink drop-down options, but in a single field? I could be missing something, but recognize this scenario isn't supported OOTB.

One question we are missing here is to consider if those links are going to be used somewhere else individually. If that's the case, multiple components would be my first choice, so we can reuse each component several times.
If you are planning to allow the editor to create a list of links that they are only going to use in a given component (not reusable), well, you have all the options mentioned in the previous answers.
To give you an idea on what's the best approach (in my humble opinion) here are things to consider:
Individual Components per link: use this approach if links are reusable.
Using embedded schemas (with the link structure) so this approach can be used in different component types (schemas)
Custom URL / Single Line Text Field: it requires an additional development effort and it is very unlikely you will keep the hard-link-references when creating internal links. As you know SDL Tridion keeps a reference to the tcm id in order to resolve links, trigger publishing, etc..
Custom URL / 2 Lines RTF: It will do the job, but you need to make sure you disable all the other RTF options from the Ribbon Tool Bar within the Schema RTF options, so you meke sure that the editors can only create links. Also, you might need to consider to add an XSLT filter to check if the edtiors entered something more than just links. These links are not reusable.
In general if you implement something custom (GUI extension + Custom URL) keep in mind all the TRIDION CMS concepts, like blueprinting (what happens when the link is inherited down), where used, etc...
My recommendation has always been to use Separated Components, but be careful with the link propagation when publishing...

I have seen this case at customers. If they consider less development effort, the idea of having a multiple embedded field is good.
You can have it as:
[text] Link Text
[Component Link] Link to anything
You would need an extra Content schema for External Links, like:
[External Link] Url
[text] target
[any extra option you need]
This means the editor would need to create a new External Link Component every time they create an external link. It is extra work, but it can also mean easier maintenance on the use of external urls within their site.
Lastly, the editor would just add multiple Component Links, those being of schema External Link of any other. It will be the template code which checks on the schema of the linked Component and add the code accordingly.

XML Name Description Field Type
[text] Text Text
[title] Title Text
[static_url] External URL Text
[component] Internal URL Component Link
In the field description for "External URL" and "Internal URL" you could add a comment to make sure that the editor doesn't get confused, only one of these two fields should be filled in. From the component, its ID can be used to create the dynamic link in the DWT. This solution has no development effort and for the editor is pretty much as intuitive as it can get. Of course this would be a multivalue embedded schema field inside the Links schema.

This use-case might work using a Custom URL field and maybe a GUI extension. The idea is to have a Custom URL that opens a popup (which might be a GUI extension). In that popup, you would select/construct your link (maybe using the same options as a normal RTF link - Component, Anchor, mailto, etc).
The popup would return a specially crafted string. The format could be anything, even an actual anchor tag (but JSon is also fine). Example: {href:'tcm:1-2',type='component'}.
Your Templates would interpret this string in order to generate something meaningful, like a dynamic link or static HTML anchor.
Also the Custom URL popup should be smart enough to 'decode' such a link (if a value was specified in that field previously) and maybe pre-populate some attributes in the RTF link constructor form.

Related

Extending the GUI fields

I would like to extend the individual GUI elements, do some custom processing and later call the default function.
For example: Whenever a particular Input Element is selected in the Component window, I would like show a TooTip to the user associated with that field.
Kindly provide some pointers.
#
Sorry for my earlier attempt in framing the question Reframing it
again.
#
Actually I have a schema with four fields, My requirement is to show a
help text, whenever the focus is on a particular field.
One of the field holds Country Name: So when the focus is on the
Country Name ( Single Text Field ) I need to show "Please enter the
Country Name" on the text field. So that the editor understands the
same, without using the Schema Description field.
So my question was can we capture the events for all types of fields (
like Multimedia, RTF, Single Line ) in the Component Edit view ?
Hope was able to make my question more clear
You would have to extend the Component-edit screen for this. I suggest you read-up on Tridion GUI extensions:
www.sdltridionworld.com,
SDLLivecontent
Tridion Developer blog
Also, searching stackoverlow might help: Extending the publish screen
A valuable source of examples is the PowerTools project. You can find it here
Asking a more specific question allows us to help you more specific.

Extension to the page icon status in SDL Trdidion 2009

We are using SDL Tridion 2009 SP1.
We have implemented a new functionality, an extension in our CMS which allowed us to lock a page.
If a page it is locked it cannot longer be published ( the information of a page that is locked is kept in a database which was created for this extension).
We want to add a new icon which will notify the user on the new status of the page.
Now there are 4 combination of icons ( no action , checked , published , checked and published )
Since I do not have a long experience with the CMS interface I want some help on finding a solution that have no impact on performance and
that it easy to implement in terms of not doing of lot of modification.
Below is my investigation regarding this:
I noticed that the way the icons are render in the cms is not a simple mechanism that can be easy updated.
Each time we click on an item in the left side of the CMS, in order to render the list from the right side a ajax call (with an xml request) is done to the WebGUIResponder.aspx. page.
The response we will get back is a xml that contain the attribute field Icon
<tcm:ListItems xmlns:tcm="http://www.tridion.com/ContentManager/5.0"
ID="tcm:yyy-zzzz-4" Managed="68" ItemType="4">
<tcm:Item ID="tcm:yyy-zzzzz-64" Type="64" Title="NotificationTest"
Modified="2011-05-09T09:42:27" FromPub="400 YYYY Website Master (EN-GB)"
IsNew="false" Icon="T64L0P1"/>
</tcm:ListItems>
Based on this field Icon attribute (Icon="T64L0P1) the image name starts to be processed.
T64 = means it is a page
L0 = is not checked
P1 = it is already published
For such a field the image name result will be = T64.16x16.List.Published.gif
I couldn't find a way to update this field through the page xml, is not an information that is kept in the xml but rather is build in the dll when the
xml request . (Somewhere based on other fields like published and something else this Icon field is calculated.)
So if it is not possible to modify this field the option we may have is:
In order to integrate our change in the CMS without modifying their .dll (this for compatibility with the new version of the SDL Trdion is not good to modify in the dlll)
and without changing too much the logic I was thinking to this approach.
We can make a new Ajax call to a a new page WebGUICheckPageLocked.aspx (need to be tested what will be the impact on the performance).
In the code behind of this page we can determine if the page is locked or not ( used our internal function that determine if the page is locked or not this functionality is already done).
In the page we will change the icon field to something T64L0P1E01 (adding some extra information which will allowed us to determine the new status of the page ).
We will also modify the In the GetPNGIconName javascript function we can then make an extra check taking in consideration the new information E01 ...)
Please if someone have some better idea on this, maybe it is something easy that can be done, maybe it is a way we can update the Icon field.
Kind Regards,
Cristina
I'll paste my answer from the forums here, so everyone can see (and maybe bring ideas on how to do it differently?)...
In 2011 I would use a Data Extender to change the icon.
Since this is 2009 you will need to use the less elegant predecessor: the GUI Responder Extension.
Essentially you need to manipulate the XML that is returned for the relevant requests (such as the GetList on a Folder).
I couldn't immediately find any documentation on this - which is not surprising as it is an older version. But it boils down to this:
Create a .NET assembly containing a class with the following method signature and attribute:
[ResponseMessageHandler]
public XmlDocument HandleMessage(XmlDocument messageXml, string userName, HttpContext httpContext, object tcmSession)
In that method, you can change the icon set in the XML based on your own logic.
In the extension configuration file, add a section to hook into the response for the lists you care about
(substitute "YourResponderExtension.dll" with the name of the assembly you added):
<ProcessResponse>
<!-- GetList -->
<ExecuteWhen>/tcmapi:Message/tcmapi:Response/tcmapi:Request/tcmapi:GetList</ExecuteWhen>
<!-- Handler for all of the above -->
<Execute>/bin/YourResponderExtension.dll</Execute>
</ProcessResponse>
Add more elements before the if applicable - and make the XPath query as specific as you can to avoid your extension being called unnecessarily. You might also need to check for more cases in the .NET code that you can't do with the XPath query.
ZIP up your extension and deploy it with TcmExtensionInstaller.exe.
From your text I'm assuming you've already worked out how to create and package an extension in 2009.
I hope that these smalls steps can get you started.
If you have any trouble or follow-up questions, just let me know and I'll see if I can answer them.

Custom Parser for Nutch (or open source .NET Crawler)

I have been using Nutch/Solr/SolrNet for my search solutions, I must say, it works a treat. On a new site I'm working on, I am using Master pages, as a result, content in the header and footer is getting indexed and distorts the results. For example, I have a link to the Contact Us page in the header. Now, when I search for 'Contact' the result returns all the pages in the site.
Is there a customizable Nutch parser that i can maybe pass a div id and then it only indexes content inside the div.
Or if there are .NET based crawlers that I can customize.
See https://issues.apache.org/jira/browse/NUTCH-585
and https://issues.apache.org/jira/browse/NUTCH-961
BTW you'd get a more relevant audience by posting to the Nutch user list
You can implement a Nutch filter (I like Jericho HTML Parser) to extract only the parts of the page you need to index using DOM manipulation. You can use the TextExtractor class to grab clean text (sans HTML tags) to be used in your index. I usually save that data in custom fields.

Add dynamic URL (or button) to each node in Drupal

I've used CCK to create a 'Travel Offer' content-type which basically just lists the details for a travel package.
My question is how to have a button or link on each node (when the user views it) that will link to a url that includes the title of the current node (eg: example.com/requestQuote/Title_Of_This_Node).
I haven't implemented my system yet so I am free to change the content-type to include a button field or something like that...
The easiest way to accomplish this would be by adding a node-your_content_type_name.tpl.php file into your theme folder. (If you haven't done this before, all you need to do is create a duplicate of node.tpl.php and rename the copy to node-your_content_type_name.tpl.php)
The '$title' variable is available within the node template, so it should be easy to craft a little bit of PHP to print out the appropriate link target.
Edit:
Now, if you want to get a little bit fancier, you could build the link to reference the unaliased node page ('example.com/requestQuote/node/11569' or whatever) and feed it through Drupal's handy l() function to build the hyperlink.
The advantage here is that you won't need to worry about the link changing if the title changes, even though l() will automatically update the actual hyperlink that's displayed to the user.
This will probably make the custom coding on your 'example.com/requestQuote' page a lot easier too, since you can work directly with the node ids and don't need to parse titles.

Kentico CMS search results

How do I change the Kentico CMS search settings so as to display a part of text from search results as in Google? Presently it shows only the path in the results.
It depends on how you have your search setup really.
At the page level if you are using the Portal Engine model, which the majority of people use now, you have to check the Widget that you are using, basically it boils down to a regular search or Smart Search.
If your using the ASPX Template model you may have to open up your source for the page and see which usercontrol file your using from ~/CMSWebParts/Search/ or ~/CMSWebParts/SmartSearch/
Once you figure out which user control you are using it's a matter of inspecting the Transformation that it uses. Most likely you'll be using one of the following:
CMS.Root.SearchResults
CMS.Root.SmartSearchResults
CMS.Root.SmartSearchResultsWithImages
Click on Edit Transformation and check out which field is inside the Call to SearchHighlight, normally, "Content". Then you know it's pulling from the main content of the document. I've also seen this be tied to a different field like "Title" or "Caption". But the default is "Content".
If you still dont see results with part of the text, make sure you have a Smart Search Index setup, found in CMSSiteManager -> Administation -> Smart Search. If you don't see your site in the Index list then you need to add one. Make sure you rebuild it and optimize it (click edit on the row to get to those options). After that is all rebuilt then you should see the text appear under the result.
One thing to note, is that as #jao has mentioned, this only takes the first 280 characters of the content of the page. If you're matching search text doesn't happen to be in the first 280 characters, then no highlighting will occur.
try the following in your search result transformation:
<p>
<%# SearchHighlight(HTMLHelper.HTMLEncode(TextHelper.LimitLength(HttpUtility.HtmlDecode(HTMLHelper.StripTags(GetSearchedContent(DataHelper.GetNotEmpty(Eval("Content"),"")),false, " ")), 280, "...")),"<span style=\"background-color: #FEFF8F\">","</span>") %>
</p>
This will show the first 280 characters from your content, with the search terms highlighted.

Resources