How to split field logic in two? #16361
Unanswered
tropcicstefan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Trying to build a theme for documentation page, specifically markdown field(
Body
) that represents article(DocsArticle
) body, but also TOC for that article (like orchard docs right side there are links to headings). I am parsing markdown in a display driver and making a list of items in toc and passing them inside view model. Now because of html template i need to separate text of markdown field from TOC meaning I want multiple shapes to represent single field, because of structure of html in a themeIdea was to make another display type for markdown field. Like we have
Detail
I wanted to makeTOC
display type and then in article template do something likeThat markdown field has specific 'display mode'
Docs
so shape type isMarkdownField_Display__Docs
. So on second part when I want to render TOC one of these templates should work (MarkdownField__Docs_Display_TOC
,MarkdownField_TOC__Docs_Display
) or filesMarkdownField-Docs.Display.TOC.cshtml
,MarkdownField_Display__Docs.TOC.cshtml
) but no luck I can't get them to display.Second idea was to register another shape in driver so I had
when i console log shape it's there meaning it should be rendered but template is always same as
Detail
, meaning couldn't connect different template to it. I triedMarkdowntoc
,Markdowntoc_Display
Any ides what I am doing wrong here?
Beta Was this translation helpful? Give feedback.
All reactions