Inhalte aufrufen

Profilbild

Add Feature add picture in Discount table


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
7 Antworten zu diesem Thema

#1 thomasaldwin

thomasaldwin

    Newbie

  • Members
  • Punkt
  • 4 Beiträge

Geschrieben: 09 May 2016 - 09:24

Excuse me, i wanna ask something about my project. I want to add a new feature upload photo in tab discount. Im copy paste source the picture from category view to discount view but it doesn't work. I have add model and discount view model too. In discount, createOrUpdate.cshtml doesn't call Picture.cshtml in shared/editorTemplates in smartstore.admin. Could you help me? I attach the screenshot.Angehängte Datei  Ask.png   295.23K   1 Anzahl Downloads



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 09 May 2016 - 10:01

Have you decorated the view model property (e.g. PictureId) with the attribute [UIHint("Picture")]?

  • thomasaldwin gefällt das

Marcus Gesing

Smartstore AG


#3 thomasaldwin

thomasaldwin

    Newbie

  • Members
  • Punkt
  • 4 Beiträge

Geschrieben: 09 May 2016 - 10:38

I've decorate the view model with UIHint('Picture') but nothing happened.

Angehängte Datei  Ask2.png   516.48K   0 Anzahl Downloads



#4 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 09 May 2016 - 16:48

Could you please try again with:

@Html.EditorFor(model => model.PictureId, "Picture", new { transientUpload = true })

Please note that the second argument is the template name.


  • thomasaldwin gefällt das

Murat Cakir
SmartStore AG


#5 thomasaldwin

thomasaldwin

    Newbie

  • Members
  • Punkt
  • 4 Beiträge

Geschrieben: 10 May 2016 - 03:51

it works well. Thank you Murat & Marcus.



#6 ChintuUser

ChintuUser

    Newbie

  • Members
  • Punkt
  • 4 Beiträge

Geschrieben: 16 March 2018 - 05:57

Hi ,

 

I have created one new plugin and trying to get the file upload for image. When I tried the same was getting editor only not the file upload. Can you please help.

 

[UIHint("Picture")]
[SmartResourceDisplayName("Plugins.Widgets.Slider.Picture")]
public int Picture1Id { get; set; }
 
configure.cshtml
<td class="adminTitle">
 
@Html.SmartLabelFor(model => model.Picture1Id)
</td>
<td class="adminData">
@Html.EditorFor(model => model.Picture1Id, "Picture", new { transientUpload = true })
</td>
</tr>
  
 
but still I am not seeing the upload button or image. can you please help.

 



#7 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 16 March 2018 - 10:29

Have you decorated the action method with the AdminThemed attribute?

  • ChintuUser gefällt das

Marcus Gesing

Smartstore AG


#8 ChintuUser

ChintuUser

    Newbie

  • Members
  • Punkt
  • 4 Beiträge

Geschrieben: 16 March 2018 - 15:53

Thanks Marcus I am missing this piece... It worked :-) Thanks a ton