November 2007 - Posts

MOSS 2007 : Displaying User Picture Profile
25 November 07 04:36 PM | cakriwut | with no comments

English (versi bahasa Indonesia)

Recently I’ve got a question how to display user picture profile. 

Up5

Again, there are many approach – however I’ll show you with no code approach. First, I want to emphasize that this approach can be used to answer other customization which uses SharePoint’s ootb controls.  

So, here we go. Open the default.aspx using SharePoint designer and look at the toolbox control on the right pane. You’ll see several categories ie. ASP.NET Controls, SharePoint Controls etc. In this case we need Server Controls (SharePoint) – it will available if you work with MOSS 2007 not WSS v3.0.

Up1

Expand Server Controls (SharePoint) and there are many specific controls from SharePoint Server WebControls. To show user picture profile, we need ProfilePropertyImage from SharePoint Server WebControls. I guess you understand how to pick-it-up, just drag-drop from the toolbox into designer pane.

Up2

In this case I drag-drop from toolbox pane to the empty space just above default WebPartZone in default.aspx.

Up3

Giving a center tag arround the ProfilePropertiImage, will give you just like mine.

Up4

Then, save the page to see the result; an avatar will be shown for any users who already customize their profile image.

At last, if you can not see the image, please check if the tags looks similar with

<SPSWCrofilePropertyImage PropertyName="PictureUrl" ResizeToFit="100" RenderWrapTable="True" ShowPlaceholder="true" id="PictureUrlImage" runat="server"/>

Please pay attention that “PropertyName” of the tag should be “PictureUrl”.

Indonesia (see English version)

Baru-baru ini saya mendapat pertanyaan bagaimana cara menampilkan gambar yang ada di profile user.  

Up5

Sama seperti artikel-artikel saya sebelumnya, ada banyak cara yang dapat kita lakukan – dan lagi-lagi saya tetap menganjurkan untuk menggunakan teknik dengan sedikit coding. (no code approach). Sebelum melanjutkan, saya juga ingin menggaris-bawahi bahwa teknik ini dapat pula digunakan untuk melakukan kustomisasi lain yang membutuhkan kontrol bawaan dari SharePoint.   

Pertama-tama buka “default.aspx” dengan menggunakan SharePoint designer. Lihat pane “toolbox control” yang ada disebelah kanan – kalau belum muncul masuk ke dalam menu “Task Pane” dan pilih Toolbox control.  Disana kita bisa dapatkan beberapa kategori misalnya, ASP.NET Controls, SharePoint Controls dsb. Dalam kasus ini yang kita butuhkan adalah Server Controls (SharePoint) – kategori ini akan muncul jika kita bekerja dengan MOSS 2007.

Up1

Buka Server Controls (SharePoint) dan didalamnya akan kita dapatkan beberapa kontrol yang diambil dari SharePoint Server WebControls.  Untuk menampilkan gambar profile user yang kita butuhkan adalah ProfilePropertiImage. Klik di ProfilePropertyImage dan drag-drop kedalam default.aspx yang sedang dibuka di panel designer.

Up2

Untuk mendapatkan hasil seperti yang diinginkan diatas, saya memasukkan control tersebut keatas WebPartZone yang ada dibagian kanan (lihat gambar dibawah).

Up3

Kemudian dengan menambahkan tag “center” maka ProfilePropertiImage akan tampil rata kanan-kiri, sama seperti dibawah ini.

Up4

Akhirnya, simpan halaman tersebut dan buka dengan browser; sampai disini kita akan dapat melihat gambar profile user. Dan jika user melakukan kustomisasi gambar profilenya, maka secara otomatis gambar diatas juga akan menampilkan avatar yang sesuai.

Pada tahap ini, jika Anda gambar profile tidak muncul – coba cek tag yang baru disisipkan apa sudah terlihat seperti ini, 

<SPSWCrofilePropertyImage PropertyName="PictureUrl" ResizeToFit="100" RenderWrapTable="True" ShowPlaceholder="true" id="PictureUrlImage" runat="server"/>

Perhatikan bahwa “PropertyName” harus diisi dengan “PictureUrl”.

 

 

Share this post: | | | |
How to enable "Edit Page" in SharePoint's standard form.aspx
03 November 07 02:28 PM | cakriwut | with no comments

English (versi bahasa Indonesia)

Just like the old version, if we want to add additional web part in standard form (newform.aspx, editform.aspx, dispform.aspx) then we have establish a strategy to view the page in edit mode. However, the new page model in SharePoint 2007 makes our job more easier.

NewItemAction

Picture 1a. No “Edit Page” in SharePoint form.

 

NewItemInEditMode
Picture 1b. NewForm.aspx in Edit Mode

Actually we can change site template definition, but since I don’t want to modify all forms, then I choose to edit directly using SharePoint Designer (SPD) . I open the site using SPD, go through target list and open “NewForm.aspx” in the designer.

NewItemEdit

Picture 2. Open NewForm.aspx using SharePoint Designer

Having the form in the designer, then I go to “Site Action” content template (by default it is master page content place holder). So I click on it to “Create Custom Content”.

NewItemMaster

Picture 3. Create Custom Content in Site Action section

Switched into code designer for the new content block then look for <SharePoint:MenuItemTemplate tag. There are few tags, but the point of interest for our project is the one with “MenuItem_EditPage” id. Change the id to anything you’d like – mine, I change it to “MenuItem_EditPage1”.

NewItemMaster2

Picture 4. Change the id for MenuItemTemplate

Save the changes and now goto NewForm.aspx. See a new “Edit Page” command in Site Action.

NewItemWithEdit

Picture 5. Edit Page menu command in “Site Action”

o0o—

Indonesia (see English version)

Sama seperti di versi sebelumnya, jika kita ingin menambahkan web part di form-form standar SharePoint (newform.aspx, editform.aspx, dispform.aspx) maka kita harus bisa menampilkan form tersebut dalam mode edit. Namun kali ini pekerjaan kita akan jauh lebih sederhana dengan diperkenalkannya master page dan page layouts di SharePoint 2007.

NewItemAction

Picture 1a. “Edit Page” tidak bisa ditemukan di form standar.

 

NewItemInEditMode
Gambar 1b. NewForm.aspx dibuka dalam mode edit

Ada dua pilihan yang dapat dilakukan yaitu melakukan perubahan secara global di definisi site template atau melakukan perubahan secara terbatas di masing-masing list. Karena tidak semua list perlu perubahan ini, maka saya akan melakukannya secara terbatas dengan mengedit “NewForm.aspx” secara langsung dengan menggunakan SharePoint Designer (SPD).

NewItemEdit

Gambar 2. Buka NewForm.aspx dengan menggunakan SharePoint Designer

Setelah form tersebut terbuka, arahkan mouse ke area “Site Action” (secara default area ini mengambil definisi dari master page). Context menu di area ini memungkinkan kita untuk mendefinisikan konten secara khusus dan tidak mengambil definisi dari master page. Klik di “Create Custom Content”.

NewItemMaster

Gambar 3. Create Custom Content pada area Site Action

Ubah tampilah SPD ke bagian source code dan disana kita akan dapat menemukan blok yang berisi tag <SharePoint:MenuItemTemplate . Kita bisa menemukan beberapa tag semacam itu, tapi target kita adalah tag yang memiliki id “MenuItem_EditPage”. Ubah nama id menjadi nama lain – disini saya mengubahnya menjadi “MenuItem_EditPage1”.

NewItemMaster2

Gambar 4. Ubah id dari MenuItem Template

Simpan seluruh perubahan diatas dan buka kembali NewForm.aspx. Arahkan kursor ke Site Actions dan disana kita bisa melihat command menu “Edit Page” seperti yang diharapkan. Dan mulai sekarang dengan mudah kita bisa menambah / menghapus web part di halaman itu.

NewItemWithEdit

Gambar 5. Menu Edit Page di “Site Action”

o0o—

Share this post: | | | |