Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello all,
I install Umbraco version 7.4.1.
I made one parent document type and set one template to it and allow this document type at root.
I made one Child document type with rich text editor property and also set one template to it and allow this document type below parent.
I made one content page of parent document type after that i create child pages.
Now,I need child node of parent document type. so i write below code for it.
var items = Umbraco.TypedContentAtRoot().Where("DocumentTypeAlias == \"parentDoctypeAlias\"").FirstOrDefault().Children; foreach (var item in items) { var teststring= item.GetPropertyValue<string>("proprtyalias", true); }
value of teststring is always return with <p>sample string</p> for my requirement i must use RTE.
<p>sample string</p>
I tried to Edit tinyMceConfig.config file,i added one line of code into it as shown below,but it is not working.
tinyMceConfig.config
<config key="forced_root_block"></config>
Any Help would be appreciated,
Thanks,
Ronak Panchal.
Hi Ronak,
You can render your data like that :
@Umbraco.Field("fieldName", removeParagraphTags:true)
Did you try to change it like in this post - http://scottsdevblog.com/2011/08/get-rid-of-those-pesky-p-tags-in-umbracos-tinymce-editor/
Thanks
Hi alex,
I need tried http://scottsdevblog.com/2011/08/get-rid-of-those-pesky-p-tags-in-umbracos-tinymce-editor/
but its not working.
can you please explain me how to use@Umbraco.Field("fieldName", removeParagraphTags:true) on another template.
i use var teststring= item.GetPropertyValue<string>("proprtyalias", true); as you see in my question.
var teststring= item.GetPropertyValue<string>("proprtyalias", true);
Ronak
If you want to get Umbraco.Field from current page you have to use @Umbraco.Field("fieldName", removeParagraphTags:true).
If you want to get Umbraco.Field from items in foreach, try to use:
var items = Umbraco.TypedContentAtRoot().Where("DocumentTypeAlias == \"parentDoctypeAlias\"").FirstOrDefault().Children; foreach (var item in items) { var teststring = Umbraco.Field(item, "proprtyalias", removeParagraphTags: true); }
Try Like this
@Html.Raw(Teststring)
It will show the output without any tags
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Rich Text Editor value always return with <p></p> tag.
Hello all,
I install Umbraco version 7.4.1.
I made one parent document type and set one template to it and allow this document type at root.
I made one Child document type with rich text editor property and also set one template to it and allow this document type below parent.
I made one content page of parent document type after that i create child pages.
Now,I need child node of parent document type. so i write below code for it.
value of teststring is always return with
<p>sample string</p>
for my requirement i must use RTE.I tried to Edit
tinyMceConfig.config
file,i added one line of code into it as shown below,but it is not working.Any Help would be appreciated,
Thanks,
Ronak Panchal.
Hi Ronak,
You can render your data like that :
@Umbraco.Field("fieldName", removeParagraphTags:true)
Did you try to change it like in this post - http://scottsdevblog.com/2011/08/get-rid-of-those-pesky-p-tags-in-umbracos-tinymce-editor/
Thanks
Hi alex,
I need tried http://scottsdevblog.com/2011/08/get-rid-of-those-pesky-p-tags-in-umbracos-tinymce-editor/
but its not working.
can you please explain me how to use
@Umbraco.Field("fieldName", removeParagraphTags:true)
on another template.i use
var teststring= item.GetPropertyValue<string>("proprtyalias", true);
as you see in my question.Thanks
Ronak
Hi Ronak,
If you want to get Umbraco.Field from current page you have to use @Umbraco.Field("fieldName", removeParagraphTags:true).
If you want to get Umbraco.Field from items in foreach, try to use:
Thanks
Try Like this
It will show the output without any tags
is working on a reply...