Umbraco 8 how to line break in textareaEditor - umbraco8

When using Umbraco textarea, I need to have multiple lines with the <br/> tag
code is here
var subTitle = item.Value("sliderSubTitle");
and html code is
div>
#subTitle
</div>
but data comes in single line

Can you check this?
<div>
#Html.Raw(subTitle.Replace("\n", "<br />"))
</div>

Related

Perl Scrappy select using class attribute

I was trying to scrape using Perl Scrappy. I would like to select html elements with class attribute using 'select'.
<p>
<h1>
<a href='http://test.com'>Test</a>
<a href='http://list.com'>List</a>
</h1>
</p>
<p class='parent-1'>
<h1>
<a class='child-1' href="http://sample.com">SampleLink</a>
<a class='child-2' href="http://list.com">List</a>
</h1>
</p>
I need to get element('a' tag) with class name 'child-1' which is a child nod of <p class='parent-1'> using select method.
I have tried like this
#!/usr/bin/perl
use Scrappy;
my $scraper = Scrappy->new;
$scraper->get($url);
$scraper->select('p a')->data;
But it will select the first 'p' tag also.
Could you please help me with this?
Bearing in mind choroba's warning, to select an <a> element with a class of child-1 that is a child of a <p> element with a class of parent-1 you would write
$scraper->select('p.parent-1 > a.child-1')
The problem is that in HTML, a <p> tag can't contain a <h1> tag. In fact, the HTML is parsed as
<p></p>
<h1>
<a href='http://test.com'>Test</a>
<a href='http://list.com'>List</a>
</h1>
<p class='parent-1'></p>
<h1>
<a class='child-1' href="http://sample.com">SampleLink</a>
<a class='child-2' href="http://list.com">List</a>
</h1>

tt_news: wrap around image including caption?

I am trying to get a wrapper element around an image including its caption in the single view in tt_news for Typo3 6.1. How would I do that?
So far I only figured out how to do that for either all images
plugin.tt_news.displaySingle.imageWrapIfAny = ...
or the caption itself
plugin.tt_news.displaySingle.caption_stdWrap.dataWrap = ...
. But I have no clue how to create a wrapper for each single image including its caption...
Thanks in advance!
I know this is quite old, but as a follow-up that works in TYPO3 6.x you can use:
displaySingle.image.wrap = <div class="news-img">|
displaySingle.caption_stdWrap >
displaySingle.caption_stdWrap.wrap = <p class="news-single-imgcaption">|</p></div>
So each image and caption gets wrapped by <div class="news-img">...</div>
The following HTML will be provided by the below TS:
<div class="newsImage">
<div class="imageHolder">
<img />
</div>
<div class="captionHolder">
Caption
</div>
</div>
TypoScript:
displaySingle {
imageWrapIfAny = <div class="newsImage">|</div>
image {
file.maxW >
file.maxH >
file.width = 220
stdWrap.wrap = <div class="imageHolder">|</div>
altText.field = imagealttext
}
caption_stdWrap >
caption_stdWrap.wrap = <div class="captionHolder">|</div>
}

How to Show or Hide the date using asp classic

Im using a form to give the user the option to show or hide the date on a webpage, either yes or no.
I am using cookies to store the option but i can find or figure out how to display or not display the date on the page.
I have been trying to process the yes or no option using an IF statement that will then be used as a css stylesheet for the webpage.
Maybe im going about it all wrong.
Regards
Trev
EDIT STARTS HERE
My code so far (not working, dont even know if im on the right track)
Code in the css/asp processing style sheet called styleCookieProcess.asp
<%
date= Response.Cookies("usedate")
If(date= "yes") then
Response.Cookies("wantdate") = "date()"
ElseIf(date= "no") then
Response.Cookies("wantdate") = "None"
End If
%>
And this is the code in my Webpage:
<html>
<head>
<link rel="stylesheet" type="text/css" href="styleCookieProcess.asp">
<title>About Us</title>
</head>
<body>
<p>Current Date <%
Response.Write(Response.Cookies("wantdate"))
%></p>
<P ALIGN = "CENTER">
<IMG SRC = "Images\About_Us.png" HEIGHT = "250" WIDTH = "715">
</P>
<TABLE ALIGN = "CENTER">
<tr>
<th>
<DIV ALIGN = "CENTER">
<P>
We have been around the block and back and have the t-shirt to prove it!
The Glad Rag Team
</P>
</DIV>
</th>
</tr>
</TABLE>
</body>
</html>
Regards, Bubs
try this
<%
date= Response.Cookies("usedate")
If(date= "yes") then
Response.Cookies("wantdate") = "date()"
Else
Response.Cookies("wantdate") = "None"
End If
%>

Parsing HTML String in to ios

I am parsing html tags into ios using TFHpple successfully, but here i got a small problem,
if my HTML Tag is
<div align="center">
<b>
<a href="/?PageName='TeacherPage'&StaffID=194121">
<span class="sectionheader">
Jessica
Cortes
</span>
</a></b><BR>
<span class="subheader">Migrant Education</span>
<BR>
<img src="/images/Phone.gif" width="22" height="23">
912-367-8630
<img src="images/EmailIconSmall.gif" width="16" height="16" style="vertical-align:bottom" />
<a onclick="openme('z','/Common/Email/Email.asp?UserID=194121&SchoolID=786',417,320);return false;" href="#">Email</a>
<BR><BR>
View All Teachers
<BR><BR>
<table cellpadding="4" cellspacing="4" class="subnavtd">
i am parsing it in to ios by using example: NSString *tutorialsXpathQueryString = #"//div/span[#class='subheader']]";
now in one of the HTML page there is no Tag, it has just a number like 912-367-8630 now how to call this in NSString *tutorialsXpathQueryString = #" this number is in above given tags
Are you able to reform the HTML output and wrap that phone number in a tag that you can target? If not, you will probably have to grab the inner text value of a parent div and regex match for a phone number pattern in the string.

Text is not visible in IE6

I'm doing a site (asp.net mvc2) that should work in IE6 as well.
On a page I inject a control as partial view.
<div id="LocationContainer">
<% Html.RenderPartial("../Shared/EditTemplates/ContactInfoTemplate",
new ContextAwareViewModel<ContactInfoViewModel>()
{
ProcessStep = ProcessStep.Configure,
Model = Model.ContactPerson
}); %>
</div>
It contains following snippet of code:
<div style="margin-bottom: 10px;">
<%= Html.CheckBox(Model.Model.ContactType + ".IsDTBranch",
Model.Model.PersonViewModel.IsTDBranch,
new { #class = "tdBranchChkBox"}) %>
<%= Html.Resource("Resources, ThisIsTDBranchLabel") %>
</div>
That gives in the end this html:
<div style="margin-bottom: 10px;">
<input class="tdBranchChkBox" id="EventContact_IsDTBranch"
name="EventContact.IsDTBranch" type="checkbox" value="true" />
Il s'agit d'une succursale de la TD
</div>
After all of this IE6 doesn't render text. But text is there and appears when I start to select area where it should be.
Does anybody know how it can be cured?
Thanks.
Long story short:
In this case, a height correction seems to have done the trick. The Holly Hack involved adding the following code to the CSS file:
/* Hides from IE5-mac */
div#content
{
height: 1%;
}
/* End hide from IE5-mac / /— Holly Hack for IE 6 Peekaboo bug —*/
The explanation for this code can be found on the John and Holly website.
Taken from here http://www.bpwrap.com/2005/08/the-internet-explorer-6-peekaboo-bug/
Thanks a lot author.