Skip to main content
Clarifying question and details
Source Link
Dan Sinclair
  • 5.5k
  • 2
  • 20
  • 44

Droplink creation Setting a new items' DropLink field value using powershell extensionPowerShell

I have createdset a value in a General link field in a Sitecore item using powershell extensionPowerShell. Here is the powershellPowerShell script.

$item.Editing.BeginEdit()                        

[Sitecore.Data.Fields.LinkField]$fieldValueLink = $Item.Fields[$templateField.DisplayName]

 $fieldValueLink.Text = "Link"
 $fieldValueLink.Title = "click on the link"
 $fieldValueLink.LinkType = "external"
 $fieldValueLink.Url = $itemRow.$fieldTrimmedValue

 $item[$templateField.DisplayName] = $fieldValueLink.Value;

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

Now I want to create fieldsset values into other field types like droplinkDropLink, multilistMultilist and droplistDropList. For creatingsetting these fieldsfield values I think I need to create Sitecore items using powershell,PowerShell and then I have to assign them to the droplink fields.fields' values, But I don't know where to start and how to proceed.

Can anyone help me out with this?

Droplink creation using powershell extension

I have created a General link in Sitecore item using powershell extension. Here is the powershell script.

$item.Editing.BeginEdit()                        

[Sitecore.Data.Fields.LinkField]$fieldValueLink = $Item.Fields[$templateField.DisplayName]

 $fieldValueLink.Text = "Link"
 $fieldValueLink.Title = "click on the link"
 $fieldValueLink.LinkType = "external"
 $fieldValueLink.Url = $itemRow.$fieldTrimmedValue

 $item[$templateField.DisplayName] = $fieldValueLink.Value;

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

Now I want to create fields like droplink, multilist and droplist. For creating these fields I think I need to create Sitecore items using powershell, then I have to assign them to the droplink fields. But I don't know where to start and how to proceed.

Can anyone help me out with this?

Setting a new items' DropLink field value using PowerShell

I have set a value in a General link field in a Sitecore item using PowerShell. Here is the PowerShell script.

$item.Editing.BeginEdit()                        

[Sitecore.Data.Fields.LinkField]$fieldValueLink = $Item.Fields[$templateField.DisplayName]

$fieldValueLink.Text = "Link"
$fieldValueLink.Title = "click on the link"
$fieldValueLink.LinkType = "external"
$fieldValueLink.Url = $itemRow.$fieldTrimmedValue

$item[$templateField.DisplayName] = $fieldValueLink.Value;

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

Now I want to set values into other field types like DropLink, Multilist and DropList. For setting these field values I think I need to create Sitecore items using PowerShell and then assign them to the fields' values, But I don't know where to start and how to proceed.

Can anyone help me out with this?

deleted 231 characters in body
Source Link
Marek Musielak
  • 24.2k
  • 3
  • 31
  • 64

I have created a general linkGeneral link in sitecoreSitecore item using powershell extension. Here is the powershell script.

                $item.Editing.BeginEdit()                        
  
                [Sitecore.Data.Fields.LinkField]$fieldValueLink = $Item.Fields[$templateField.DisplayName]

                     $fieldValueLink.Text = "Link"
                     $fieldValueLink.Title = "click on the link"
                     $fieldValueLink.LinkType = "external"
                     $fieldValueLink.Url = $itemRow.$fieldTrimmedValue
                    
                     $item[$templateField.DisplayName] = $fieldValueLink.Value;
               
                     $item.Editing.EndEdit() | Out-Null
      

Now iI want to create fields like droplinkdroplink, multilistmultilist and droplistdroplist. For creating these fields iI think iI need to create sitecoreSitecore items using powershell, then iI have to assign them to the droplink fields. But iI don't know where to start and how to proceed. 

Can anyone help me out with this.?

I have created a general link in sitecore item using powershell extension. Here is the powershell script.

                $item.Editing.BeginEdit()                        
  
                [Sitecore.Data.Fields.LinkField]$fieldValueLink = $Item.Fields[$templateField.DisplayName]

                     $fieldValueLink.Text = "Link"
                     $fieldValueLink.Title = "click on the link"
                     $fieldValueLink.LinkType = "external"
                     $fieldValueLink.Url = $itemRow.$fieldTrimmedValue
                    
                     $item[$templateField.DisplayName] = $fieldValueLink.Value;
               
                     $item.Editing.EndEdit() | Out-Null
     

Now i want to create fields like droplink, multilist and droplist. For creating these fields i think i need to create sitecore items using powershell, then i have to assign them to the droplink fields. But i don't know where to start and how to proceed. Can anyone help me out with this.

I have created a General link in Sitecore item using powershell extension. Here is the powershell script.

$item.Editing.BeginEdit()                        

[Sitecore.Data.Fields.LinkField]$fieldValueLink = $Item.Fields[$templateField.DisplayName]

 $fieldValueLink.Text = "Link"
 $fieldValueLink.Title = "click on the link"
 $fieldValueLink.LinkType = "external"
 $fieldValueLink.Url = $itemRow.$fieldTrimmedValue

 $item[$templateField.DisplayName] = $fieldValueLink.Value;

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

Now I want to create fields like droplink, multilist and droplist. For creating these fields I think I need to create Sitecore items using powershell, then I have to assign them to the droplink fields. But I don't know where to start and how to proceed. 

Can anyone help me out with this?

Source Link

Droplink creation using powershell extension

I have created a general link in sitecore item using powershell extension. Here is the powershell script.

                $item.Editing.BeginEdit()                        
  
                [Sitecore.Data.Fields.LinkField]$fieldValueLink = $Item.Fields[$templateField.DisplayName]

                     $fieldValueLink.Text = "Link"
                     $fieldValueLink.Title = "click on the link"
                     $fieldValueLink.LinkType = "external"
                     $fieldValueLink.Url = $itemRow.$fieldTrimmedValue
                    
                     $item[$templateField.DisplayName] = $fieldValueLink.Value;
               
                     $item.Editing.EndEdit() | Out-Null
    

Now i want to create fields like droplink, multilist and droplist. For creating these fields i think i need to create sitecore items using powershell, then i have to assign them to the droplink fields. But i don't know where to start and how to proceed. Can anyone help me out with this.