This project is read-only.

Creating New Content within ContentItem?

Topics: Writing modules
Mar 4, 2011 at 4:54 PM
Edited Mar 4, 2011 at 4:56 PM

I am upgrading my Addresses Module to allow multiple addresses to a ContentItem.  I have the ContentPart Addresses viewable and would like to Add a link or button that would insert the new Address associated with the ContentItem via jquery(AJAX).  I don't want to post the form for the ContentItem.  Is there a sample that I can view that has this type of Submission?

Mar 4, 2011 at 7:58 PM

Nevermind on the above, I was approaching this all wrong.

My question is, Looking at Orchard.Tags, since this is similar to what I am needing.  Where or who is loading CreateTag.cshtml? Also, what are these attribute values used for like in the CreateTag.cshtml?

<button class="primaryAction" type="submit" name="submit.Create" value="yes">@T("Add Tag")</button> 
I don't see anything in the css or Scripts that would utilize the attribute values!

Mar 15, 2011 at 1:35 AM

ShapeTemplateBindingStrategy is responsible for discovering how to map shapes to templates.

- class is used in the CSS to style the button (in SafeMode and TheAdmin)
- type tells the browser that the button submits the form
- name will be used by the browser to specify the parameter name in the submitted form
- value will be the value of the form field if the button is clicked