Skip to content

Sharing Content Between Pages

Nick-smallworld edited this page Apr 28, 2011 · 4 revisions

This assumes that you have a folder of pages for partners and a folder of pages for industries and you would like to list partners related to each industry on each industry page

http://domain.com/industries/electronics.html
http://domain.com/partners/homer_simpson.html
  1. Create custom fields for Pages with the following tags:

    <$mt:PageDataPartnerEmail$>
    <$mt:PageDataPartnerLocation$>
    <$mt:PageDataPartnerHeadshot$>
    

    I’m assuming that you’ll use the Page title for the Partners full title: “Dr. Homer Simpson, Esq the 3rd”

  2. Add this to your Page archive template:

    <mt:setvarblock name="industry_basename_tag">@<$mt:EntryBasename$></mt:setvarblock>
    <$mt:include module="Partners Module" industry_basename_tag="$industry_basename_tag"$>
    
  3. Create a new module named “Partners Module” and paste this content in:

    <mt:Pages tag="$industry_basename_tag">
       <mt:PagesHeader>
    <div class="partners">
       <div class="partnerID">
           <h3>Partners</h3>
       </mt:pagesheader>
           <div class="partner">
               <p class="name"><a href="mailto:<$mt:PageDataEmail$>"><$mt:PageTitle$></a></p>
               <p class="location"><$mt:PageDataLocation$></p>
               <a href="<$mt:PagePermalink$>"><mt:PageDataPartnerHeadshotAsset><img width="87" height="116" alt="<$mt:PageTitle$>" src="<$mt:AssetURL$>"/></mt:pagedatapartnerheadshotasset></a>
               <p class="meta"><a href="mailto:<$mt:PageDataEmail$>">E-mail</a> ・ <a href="<$mt:PagePermalink$>">Biography</a></p>
           </div>
       <mt:PagesFooter>
       </div>
    </div>
       </mt:pagesfooter>
    </mt:pages>
    
  4. Now add the tag corresponding to the industry each Partner should be displayed with. ie. if Dr. Homer Simpsom, Esq the 3rd is should be associated with the “Electronics” and “Chemical” industry pages, then add the tags “@electronics” and “@chemical”…. assuming these (minus the “@”) are the basenames of the industry pages.

  5. Save the Partner page

  6. Rebuild the Industry page
Clone this wiki locally