I am storing this string within a ResourceFile:
Please select a #Html.ActionLink("Personal", "PersonalAccount", "Help"),
or a #Html.ActionLink("Corporate", "BusinessAccount", "Help") account.
Now I want to put this content on a Span element inside the Title attribute.
I tried this without success :
<span class="tooltip-icon tooltip"
title="#Html.Raw(HttpUtility.HtmlDecode(ToolTips.AccountType))">
</span>
The issue is that I am seeing the regular text, not the content encoded.
Razor is not going to double parse your page, It parses your page and renders the content of your resource which is a text having # in it(Please select a #Html.ActionLink("Personal", "PersonalAccount", "Help")). It doesn't care what is in the resource.
Any how, you can't do it this way and you shouldn't, the only culture specific part of your code is the link's text which you should just put that part in your resource file not whole of that line.
Using VahidND suggestion I was able to do it without Razor inside the Resource file.
So I actually ended with this :
<span class="tooltip-icon tooltip"
title="#String.Format(ToolTips.PTAccountTypeRadio1,
Html.ActionLink(ToolTips.PTAccountTypeRadio2, "PersonalAccount", "Help"),
Html.ActionLink(ToolTips.PTAccountTypeRadio3, "BusinessAccount", "Help"))"
</span>
Related
I have a paragraph that is enclosed in artist.bio.summary. This variable contains all the details about an artist. This is fetched from somewhere else. I am printing this out inside a p tag.
My problem is there is a link inside this p tag within a a tag.
The a tag is like this;
Read more
The p tag just prints this out rather than giving me a link to click.
What should I do to act accordingly?
I am calling this property as below:
<p>{artist.bio.summary}</p>
let artist = {
bio: { summary: '' }
};
I had set this artist.bio.summary as a string initially.
And an example string that i am getting is below:
"hello Read more there"
The above string is the content of the artist.bio.summary once i received it
This is a security issue and is not allowed by React (by default) so it's as expected to not evaluate the embedded html markup, but they have a workaround if you really want to. dangerouslySetInnerHTML
<p dangerouslySetInnerHTML={artist.bio.summary}></p>
But please read up on injection attacks so you understand the consequences before using this kind of dynamic evals.
https://www.codeproject.com/Articles/134024/HTML-and-JavaScript-Injection
From you description it seems that artist.bio.summary contains the entire content i.e Read more . In that case what you need is dangerouslySetInnerHTML
<p dangerouslySetInnerHTML={{__html: artist.bio.summary}}/>
However I would suggest you to make modifications to your data such that you aren't actually passing the HTML to the React component but creating it using JSX yourself
I want to do plain text seach in html files.
It seems that properties values are not indexed.
if i have a html file containing tag like this <div property="property value"> Textual value </div> i can't found this file by searching property value.
Is there a way to make this possible ?
You need to define your own custom metadata extracter.You can fine more information on below link.
http://wiki.alfresco.com/wiki/Metadata_Extraction
For your requirement,
alfresco-community-sdk-3.4.b\src\alfresco-repository-src.zip\java\org\alfresco\repo\content\metadata\HtmlMetadataExtracter.java
Above is the class which is responsible for extracting data from the html file.If you see the content of that file it is neglecting tags and attributes inside tag.So you can take reference of above file and define your own Metadata Extractor
I want to use a web service provider (made by me) in my WebRatio project, the service I developed return a string properly formatted with newline, I try to use either \n or the <br> html tag (in the output string).
In the html document, Web ratio converts \n in spaces and prints the <br> tags as text.
How can I insert html tags (like <br>) in the page?
Edit:
Here is the output of the service (in Java)
public String toString(){
return "News \n title=" + title + "\n";} //I try using <br> instead of \n
And here is the html
<td class="value"> <!--all this HTML is printed in the same line-->
News
Titolo=bla bla
....
</td>
Using the <br> tag the main problem is to make Web Ratio avoid the conversion from the <br> output tag to a <br>
I don't know if you resolved your problem. Anyway you can manage the text as html.
For example if you want to show the text in the Message component and set "html" as content type, please follow these steps:
Select the Message component in the Layout -> Grid -> Message
component
Click on the Layout Parameters (blue button) of the Component Layout Property available in the Properties View
Select the option "text/html" for the "Content Type" Parameter (this is available in the WRDefault/Normal template).
In this way you can see the text as html.
Moreover if you want fill in a form field with the html text you have to set "html" as "Content type" Property: Select the Field in the Outline View and select "text/html" item for the "Content Type" Property available in the Properties View.
To set html as default content type for a string (or text) Attribute defined on an Entity (in the Domain Model) you can refer to the "Content Type" Property of the selected Attribute.
I hope this will help you to solve the problem.
I came across with an issue where RTF field in TRidion 2011 is removing HTML5 tags while saving component.
Issue:
Source snippet
<div>
<a class="arrow button" data-role="button" data-inline="true" href="www.google.com">Information</a>
</div>
Tridion is saving above snippet
<div>
<a class="arrow button" href="www.google.com">Information</a>
</div>
In short Tridion is removing HTML5 attribute while saving the component.
Please give some hint to resolve above issue.
For this you can extend the RTF field to allow HTML5 tags for this you have to specify these tags in a file TcmXhtml.Config at the path
[Tridion]\web\WebUI\Core\Controls\FormatArea\TcmXhtml .
Tridion uses XHTML to store rich text fields. Since the attributes you specified are not valid XHTML, Tridion removed them.
You can modify the list of attributes and elements allowed in the Rich Text Area (see Ram's answer) but keep in mind that you are now allowing these attributes to be used in all Rich Text Fields, and you have to consider the impact of this change to your whole environment. If you're doing this as a quick work-around a design limitation (which is what it sounds like) remember that EDITORS will have to do the same. Structure data shouldn't necessarily be in a RTF, and perhaps certain elements of your output should be handled by a template and not by an editor.
In the \Tridion\web\WebUI\Core\Controls\FormatArea\TcmXhtml\TcmXHTML.config file, update the tag "drop-proprietary-attributes" to be "false":
From: drop-proprietary-attributes: true
To: drop-proprietary-attributes: false
Restart the COM+ and clear the browser cache.
To answer my question, take a look at the following entry in our Knowledge Base:
http://tridion.kb.sdl.com/kb/?ArticleId=4065&source=Article&c=12&cid=19#tab:homeTab:crumb:7:artId:4504
Additionally, you can add other HTML 5 tags in the configuration file mentioned in the article above.
For example, if you wanted to stop the following tags from being removed, add:
new-blocklevel-tags: article aside canvas details figcaption figure footer header hgroup nav output progress section video
new-inline-tags: audio datalist mark meter summary time
new-empty-tags: command source track
I'm currently making a facebook application and while investigating the (X)HTML source code for a message thread page to see if it was possible to link to specific messages within threads (apparently it's not), I encountered an HTML attribute that I cannot seem to find any information about. Some span elements on the page had a 'bindpoint' attribute that was set to various values (presumably element IDs). Here is an excerpt from the page source (I replaced some private info with Xs)
<div class="GBThreadMessageRow_Info">
<span class="GBThreadMessageRow_AuthorLink_Wrapper" bindpoint="authorLinkWrapper">
XXXXXXXX
</span>
<span class="GBThreadMessageRow_Date">
April 8, 2010 at 10:13pm
</span>
<span bindpoint="branchLinkWrapper" class="GBThreadMessageRow_BranchLink">Reply</span>
<span bindpoint="reportLinkWrapper" class="GBThreadMessageRow_ReportLink"> • Report</span>
</div>
I have never seen this attribute before and any information about it would be useful/helpful/interesting. Thanks!
As was said in the comments, it has to be something they're doing in the javascript code.
Facebook uses an interesting technique to import their javascript files dynamically (basically they seem to write out script tags in the javascript, when necessary), and it's not quite as simple as just pressing ctrl-F through the first file you find.
So, in conclusion, the bindpoint attribute is something internal to the Facebook eco-system, and not standard HTML. From the name, I assume it has something to do with which events (clicks, mouseovers, etc.) should be binded to the element in question, which is signified by a variable name give in the bindpoint attribute. Or maybe it has to do with which element the element in question should be 'binded' to, like the for attribute for a label. Anyway, this is pure speculation.