In Moss, you can customize the view display by using the view style.

Source: Internet
Author: User

Today, in the moss Development Group, a buddy asked how to display images in the Image Library, just like displaying images in the Windows directory.

Of course, simply selecting "thumbnail" for the display field in the view settings is not what we want...

After providing him with ideas in the group, I got to work. I don't know how he was doing. I just had a little time, so I just got it and sent it up. It may be useful to some friends.

First look

Click the thumbnail to open the source image in the new window, and click the folder to enter directly (the folder is not specially processed here, And the URL is simply opened)

Okay. Let's talk about the implementation steps.

In fact, it is very simple to create a view style, and then select this style in the view settings:

 

How does this approach work?

The file to be modified is as follows:

C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ Global \ XML \ vwstyles. xml

 

We recommend that you use vs to open and sort out the code.

Copy the style with ID 6 and paste it to the end. Change the ID to 100 or a number greater than 20. Change diaplayname .....

The key part is that in the viewbody section, there are a lot of code, so it won't be mentioned at 1.1 points, and it will be stuck directly. You can reply to any questions.

<Viewstyle id = "100" displayname = "thumbnail by: EricInBj@hotmail.com only" basetype = "1" Preview = "_ layouts/images/prvpicl.gif" Description = "for image libraries, after setting this style, only the thumbnail of the image is displayed on the view page. By: Eric | ericwang.cnblogs.com "> <viewheader> <HTML> <! [CDATA [<div>]> 

 

 

 

But it is a bit uncomfortable: You need to manually modify this file during deployment. If there are multiple frontend, every deployment or update, it is tiring. The damn Microsoft is not doing very well here, how good is deployment like custom fields. But there is no way. We can write code to modify this file. For example, when feature is activated, add our style to the file and remove it when it is disabled. Let's talk about it later...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.