Orchard 1.6 Content Type Field problems? - asp.net

Orchard version is 1.6.
I created a new Content Type named Book, and added some Fields to this type.
I have 3 questions about fields in content type.
What is the difference between Input Field and Text Field?
How to bind Enumeration Field with data, for example, I want to create a Enumeration Field with data "Beijing", "Shanghai", "Guangzhou"?
I have uploaded a .docx file with Media Picker Field writing alternative text is This is my first attachment, but MediaPickerField link is displayed in webpage, not my written alternative text. How to solve it?
That is all. Thank you for your answers!

Great questions... The difference between input field and text field is that input field should not exist. :) I was strongly against it, because it would cause confusion, and it does... The input field is supposed to help you use the new html5 input types. The text field is about entering all flavors of text. One is surfacing an implementation detail, something specific to the rendering technology used, the other is about content semantics.
Not sure what you mean with the second question. What prevents you from doing that? The values are entered in the content type editor, in the settings that appear if you deploy the field (the little > next to it).
Side note: probably would have been best to create three different questions...

Related

Customizing Search in Orchard

Is there any option to completely control a Search module with a Summary view? I am struggling to get there. I have the following settings so far:
In admin I created an Index called PublicSearch with a number of fields.
I am getting a search result which is a mixture of two content parts - Question and Expert
I have a Part view to be used in search result for Experts called ExpertSummary.cshtml. The view only contains the following elements now:
#model dynamic
<p>Expert Summary</p>
When the search result is coming I only expect the "Expert Summary" to be visible in Expert region of the Search but I am getting an additional "body" section (truncated to X characters). It seems to me because "body" is selected as a field when I created the Index it is coming up.
Each Expert record has an image of expert which is coming up in the search result and When I take out <Place Fields_MediaPicker="Content:1" /> from Placement.info it disappears, which is fine.
But I want this summary to be completely controllable in ExpertSummary.cshtml - like a two column layout where the left col will hold the expert image and the right one will hold a brief description along with some other info - but everything would be in the View - should not come from Orchard search module as defaults.
In short I want Orchard's Index and Search modules to be functional and working like it is now but the layout and information I want to control completely using custom HTML in Parts/ExpertSummary.cshtml view.
Is this at all possible? If yes, how?
Please suggest. I am completely lost my way in Orchard framework!
I'm not completely sure I understand your question... Orchards search returns a Summary view by default. So you need to control the layout of your summary. Use shape tracing to create a new alternate to change the layout of the summary view. So ExpertSummary won't control the entire layout, it will just control the Expert part. Then use placement to decide what to display. http://docs.orchardproject.net/Documentation/Understanding-placement-info
Also, tagging questions with "orchardcms" will be more useful than "orchardcms-1.7".

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.

SDL Tridion Schema Field "List of Links" Options

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.

Trouble with getting a sort to work within a view with views_bonus_pack

This is my first time using Views in Drupal and am finding that no matter what I do, I can't seem to get my output to sort on any field at all.
I'm using the views_bonus_pack to create xml output, but not sure if that matters.
I've tried the post date field, the node Id field, the node title field, and... the output is always the same.
Any ideas?
[Update, here are screenshots of what I'm working with]
http://emberapp.com/evanmcd/images/settings-2/sizes/m.png
http://emberapp.com/evanmcd/images/untitled/sizes/m.png
And, here's the resulting XML
http://www.mapendo.org/media_viewer/items.xml
Thanks to anyone who can help.
Evan
The sort criteria are listed to the right side.
Views screenshot http://img.skitch.com/20100715-jcfqnsu8mty6r7mexeyxsis4f4.png
If you changed the sort criteria trying to get differently sorted data without to obtain any difference, then there are just two possibilities:
The sort criteria are not used for feeds; it's rather improbable.
The style plugin module has an issue, and it's not working as it should.
If Views Bonus Pack is implementing a style, each style has its own settings that change the output produced by the style. When you click on the wheel close the style name, you would see some settings fields for that purpose.
Views style http://img.skitch.com/20100711-x3ag3ew6q33r3sje36qdnd4fti.jpg
Views style settings http://img.skitch.com/20100711-mfa6xnx3ca5261uxyq5w6j75g8.jpg

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