Well you could use the .stripHtml() function...but I think it would make more sense if you rewrote your output html and changed the <p> element to a <div> element that you then apply the absolute styling too instead. Then the natural line breaks on the p element will be kept intact. You can always adjust margin, padding, font-size and line-height to suit your design. So simply do this
if (startNode.Children.Where("Visible").Any())
{
<ul class="slides">
@foreach (var page in startNode.Children.Where("Visible"))
{
<li>
<img src="@page.Image" />
<div>@page.captionText</div>
</li>
}
</ul>
}
You're very welcome - no questions are too small to be asked. The forums are also meant for having another pair of eyes on your code and your thinking. Sometimes that is what is needed in order to see the proper solution and learn something. So don't be afraid to ask - as long as you learn and progress...maybe someone else will also benefit from reading your post sometime in the future :)
Text Problem in macro
Hey,
iam tryning to get the text in my images slider to show up right.
my problem is i need to ude a RTE to enter the text becors it might need to put a link in the text,
the problem is if i do a forline break whit enter the text fucks up and stant over ethoter.
I belive the problem is that the RTE makes p Tages on evry line break, and i belive i need to remove them but dont knowe hove to
This is the propeties on the DT:
Image is a Uploade
captionText is a Rich Text Editor
Iam running on a windows 2012 server whis 2012 MSSQL server DB,
The Umbraco version is Umbraco v6.1.6 (Assembly version: 1.0.5021.24867)
The Page is live AT this link
i have made 2 slides one whit no breaks and one whit
Best regards
Michael
This it my macro:
Hi Michael
Well you could use the .stripHtml() function...but I think it would make more sense if you rewrote your output html and changed the <p> element to a <div> element that you then apply the absolute styling too instead. Then the natural line breaks on the p element will be kept intact. You can always adjust margin, padding, font-size and line-height to suit your design. So simply do this
And then of course change your CSS.
Hope this helps.
/Jan
Hi Jan,
Thanks for the advice, the sec i look at it i knew i had ask at smaler stupid question, i dint think a DIV will work so therfor i dint try it first.
but it works knowe and thanks.
/Michael
Hi Michael
You're very welcome - no questions are too small to be asked. The forums are also meant for having another pair of eyes on your code and your thinking. Sometimes that is what is needed in order to see the proper solution and learn something. So don't be afraid to ask - as long as you learn and progress...maybe someone else will also benefit from reading your post sometime in the future :)
Have a nice sunday.
/Jan
is working on a reply...