BuildDisplay - Details Page

Topics: Administration, Customizing Orchard, General, Writing modules, Writing themes
Oct 9, 2012 at 11:16 AM

hi! all!! plese help me!

- I use module BingMap, Exemple: created a record as: Latitude: 10.789 & Longitude:  106.789932

- Now, I have module Property, i want to show details of this  Property& BingMap then how can i do?

public ActionResult Create()
        {
            if (!Services.Authorizer.Authorize(Permissions.EditOwnProperty, T("Not authorized to create properties")))
                return new HttpUnauthorizedResult();

            var property = Services.ContentManager.New("Property");
            dynamic model = Services.ContentManager.BuildEditor(property);
            var editor = Shape.EditorTemplate(TemplateName: "Parts/PropertyCreate", Model: BuildCreateViewModel(), Prefix: null);
            editor.Metadata.Position = "2";
            model.Content.Add(editor);

            // Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
            return View((object)model);
        }

public ActionResult Details(int id)        {   

 var p = Services.ContentManager.Get(id);            List model = new List();
  var entry = new InfomationRealEstateDetailEntry{   

            Advantages = _propertyService.GetAdvantages().Select(r => new PropertyAdvantageEntry {Advantage = r, IsChecked =  p.Advantages.Select(a => a.Id).ToList().Contains(r.Id) }).ToList(),               

DisAdvantages = _propertyService.GetDisAdvantages().Select(r => new PropertyAdvantageEntry { Advantage = r, IsChecked = p.DisAdvantages.Select(a => a.Id).ToList().Contains(r.Id) }).ToList(),                           };

            entry.RealEstateDetail = p; 

            model.Add(entry);
            return View(new InfomationAddressIndexViewModel { propertyDetail = p, InfomationDetail = model });        }
=> It is Action Detials, View Create & Edit then show BingMap, but View Details not display BingMap?

Developer
Oct 9, 2012 at 11:31 AM

I hardly understand the problem, but what do you mean exactly by maps not displaying from Detail()? Is there an error, or the pages loads but there's nothing shown?

Oct 9, 2012 at 12:26 PM
Piedone wrote:

I hardly understand the problem, but what do you mean exactly by maps not displaying from Detail()? Is there an error, or the pages loads but there's nothing shown?

-^^ My English is not very good!!

yes! only show Details of property, BingMap nothing show! how to show BingMap Details()? I added content part in Contentype of Property

Developer
Oct 9, 2012 at 12:45 PM

No problem :-). It's hard to tell from this. Are you getting any javascript errors?

Oct 10, 2012 at 11:56 AM
Edited Oct 10, 2012 at 11:58 AM
Piedone wrote:

No problem :-). It's hard to tell from this. Are you getting any javascript errors?

thanks! i done!

- Do you know any forum or website design by Orchard? i would like to see a reference!

Developer
Oct 27, 2012 at 7:18 AM

Checkout http://www.showorchard.com/