asp.net mvc - Orchard CMS: How to display a content-item field inside a separate widget? -


i'm new orchard cms, , have been dealing creating custom theme far. i've run across issue , i'm not sure know right concepts yet want do... here goes:

i following:

  • add custom field "page" content type, called "parent title."
  • on pages, display content of parent title field inside "before main" widget zone.

so author creates new page in cms fill out fields, example:

  • page title: "company abc hiring"
  • parent title: "careers @ company abc"
  • etc.

and rendered markup orchard (slightly simplified brevity):

<div id="layout-before-main">     <div class="zone zone-before-main">         careers @ company abc     </div> </div> ... <div id="content">     <div class="zone zone-content">         <article class="page content-item">             <header><h1>company abc hiring</h1></header>              <p>some page content.</p>         </article>     </div> </div> 

i know how create custom field; don't know how (or whether) it's possible put reference field's value inside zone.

any advice appreciated - eager learn!

is there reason why want place in separate widget? can use placement.info functionality.

say have textfield attached page content type named "parenttitle". placement.info following:

<placement>     <match contenttype="page">         <place fields_common_text-parenttitle="/beforemain:5" />     </match> </placement> 

notice preceding slash @ beforemain. preceding slash means targets global zone (a layout zone).

if want grasp on placement.info , fields/names should target, enable module "shape tracing". enables @ fields on frontend , see id's target.

you can read following articles understand going on:

http://docs.orchardproject.net/documentation/customizing-orchard-using-designer-helper-tools

http://docs.orchardproject.net/documentation/understanding-placement-info


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -