sitecore - Adding HTML Text the right way in Experience editor -
our content author more comfortable using experience editor content editor , has knowledge of html.
requirement - author should able add text - along other components (carousel, banner, etc), or create whole html page using rich text editor if need to.
for eg: open experience editor of page, add banner component , below banned wants add text. (or maybe design whole page using html)
i'm handling kind of task first time , here did.
create following:
1. template name "rich text section", has 1 field "content" of type "rich text".
2. view rendering, "rich text component", points .cshtml simple html
<div class="row"> @html.sitecore().field("content", model) </div>
- a folder "rich text sections" under sitecore > content > home > components. in folder, author can add "rich text section" templates.
to add text to/or design page, author needs following.
- browse in content editor mode. add new item (say "loremipsum"), of template type "rich text", inside "rich text sections" folder.
- browse in experience editor mode. add "rich text component", set data source "loremipsum", , write html content inside.
here, author has switch both editor modes. please advise better way this.
if have insert options
set correctly on items in solution, experience editor can use insert page
home tab on ribbon. pop modal showing templates have been configured insert options
, same ones if right click on node in content editor , select insert option.
the page created child of page on. can navigate different sections of content tree enabling navigation bar
option view ribbon, selecting page , selecting "go".
edit: mis-read question. seems trying create datasource of item when component added using experience editor.
you need set datasource location
, datasource template
fields on definition item of rendering:
make sure leave data source
field empty on rendering item. when add component prompted select associated content
. editors able select existing content or create new ones.
you can read more in blog post.
Comments
Post a Comment