Skip to main content
Became Hot Network Question
deleted 195 characters in body
Source Link
Gatogordo
  • 20.3k
  • 2
  • 39
  • 100

I want to add an image to an item using powershell script and here is my code. I don't know what i'm missing..

$item.Editing.BeginEdit() [Sitecore.Data.Fields.ImageField]$fieldValueLink = $Item.Fields[$templateField.DisplayName] $fieldValueLink.Width = 1324 $fieldValueLink.Height = 577 $fieldValueLink.Alt="Image" $fieldValueLink.Value = $itemRow.$fieldTrimmedValue $item[$templateField.DisplayName] = $itemRow.$fieldTrimmedValue; $item.Editing.EndEdit() | Out-Null
$item.Editing.BeginEdit()

[Sitecore.Data.Fields.ImageField]$fieldValueLink = $Item.Fields[$templateField.DisplayName]
$fieldValueLink.Width = 1324
$fieldValueLink.Height = 577
$fieldValueLink.Alt="Image"
$fieldValueLink.Value = $itemRow.$fieldTrimmedValue
$item[$templateField.DisplayName] = $itemRow.$fieldTrimmedValue;

$item.Editing.EndEdit() | Out-Null

I want to add an image to an item using powershell script and here is my code. I don't know what i'm missing..

$item.Editing.BeginEdit() [Sitecore.Data.Fields.ImageField]$fieldValueLink = $Item.Fields[$templateField.DisplayName] $fieldValueLink.Width = 1324 $fieldValueLink.Height = 577 $fieldValueLink.Alt="Image" $fieldValueLink.Value = $itemRow.$fieldTrimmedValue $item[$templateField.DisplayName] = $itemRow.$fieldTrimmedValue; $item.Editing.EndEdit() | Out-Null

I want to add an image to an item using powershell script and here is my code. I don't know what i'm missing..

$item.Editing.BeginEdit()

[Sitecore.Data.Fields.ImageField]$fieldValueLink = $Item.Fields[$templateField.DisplayName]
$fieldValueLink.Width = 1324
$fieldValueLink.Height = 577
$fieldValueLink.Alt="Image"
$fieldValueLink.Value = $itemRow.$fieldTrimmedValue
$item[$templateField.DisplayName] = $itemRow.$fieldTrimmedValue;

$item.Editing.EndEdit() | Out-Null
Source Link

Assign media item to sitecore item using powershell script

I want to add an image to an item using powershell script and here is my code. I don't know what i'm missing..

$item.Editing.BeginEdit() [Sitecore.Data.Fields.ImageField]$fieldValueLink = $Item.Fields[$templateField.DisplayName] $fieldValueLink.Width = 1324 $fieldValueLink.Height = 577 $fieldValueLink.Alt="Image" $fieldValueLink.Value = $itemRow.$fieldTrimmedValue $item[$templateField.DisplayName] = $itemRow.$fieldTrimmedValue; $item.Editing.EndEdit() | Out-Null