This works for me in V5. What kind of error do you get? Looks like it's something in the references at the top that's giving you trouble, since that's all I changed.
But I'm not that experienced with Umbraco at all, so I have no idea what's really causing the error.
Oh, I see I misunderstood what you were doing and what you wanted to do in the first place. Sorry :) I didn't get any errors when I created a new macro/macro partial and pasted Andrews code into it unfortunately, so I don't know why you got the error.
Regarding your last question, all I could find was this:
But that only removes the first "<p>", so at the very least you get an extra "</p>" after the field value... If you have more paragraphs they get rendered with paragraph tags. This really seems like a bug though.
Since it's a quote, couldn't you use the simple editor or just a textbox for the text?
Umbraco V5 - Macro - Pull Child Page Content into Parent Page
I have a Testimonials Page with each Testimonial as a child page.
I need to pull each Testimonial into the Testimonials Page.
The only content/fields I'm pulling is testimonialQuote and testimonialName.
I'm used to doing this in XSLT, but with Umbraco 5 dropping it for Razor, I'm stuck.
I've created a Macro and Macro Partial and rendor the file:
But what do I put in the Macro Partial's file?
I need to create:
I'd do something like this
<divid="testimonials">
@foreach (var item in DynamicModel.Children)
{
<div class="testimonial">
<div class="quote">@item.testimonialQuote</div>
<div class="name">@item.testimonialName</div>
</div>
}
</div>
Thanks Andrew,
Unfortunately I'm getting a server error in :/
Can anyone test this V5?
This works for me in V5. What kind of error do you get?
Looks like it's something in the references at the top that's giving you trouble, since that's all I changed.
But I'm not that experienced with Umbraco at all, so I have no idea what's really causing the error.
Ar, it works as a normal Partial and added to the Template.
I was creating a Macro Partial and Macro and then adding the macro into the rich text editor...
Thanks guys!
What build are you using? I can't get RTE insert to work with surface controllers in Fridays nightly (see http://issues.umbraco.org/issue/U5-274?projectKey=U5) it used to work though!
BTW how do I insert pretty code in this forum...??
Is there a way to remove the paragraph tags? I'm using a Rich Text Editor for the Quote.
I need to add removeParagraphTags: true to .quote
Oh, I see I misunderstood what you were doing and what you wanted to do in the first place. Sorry :)
I didn't get any errors when I created a new macro/macro partial and pasted Andrews code into it unfortunately, so I don't know why you got the error.
Regarding your last question, all I could find was this:
But that only removes the first "<p>", so at the very least you get an extra "</p>" after the field value...
If you have more paragraphs they get rendered with paragraph tags. This really seems like a bug though.
Since it's a quote, couldn't you use the simple editor or just a textbox for the text?
Sorry I can't help more then that, but I found these on the subject (haven't read them though):
http://our.umbraco.org/forum/developers/razor/19379-Remove-paragraph-tags-with-razor
http://stackoverflow.com/questions/7122802/how-to-remove-html-tags-from-rich-text-editor-in-umbraco-razor ;
@Andrew: Select the code snippet and change the format from Paragraph to Preformatted.
If people are still wondering:
will paste the content's HTML
Actually, even better:
It will then use the FieldRenderer, which in turn also renders embedded macros, e.g.
I'm not sure if this works with DynamicModel.Children, though; I'm using Model.Children...
has anyone got a solution of this same issue in XSLT
is working on a reply...