In a list row template I need to know if a row field value matches the previous row's to toggle some HTML. How should I go about this?
I've tried caching the key in ViewBag, but that doesn't persist across the sibling zones.
The cleanest would probably be to override the List shape rendering (see http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx) and add the information you need on each item shape on the fly.
Related
I have a situation wherein I need to display all documents in view. Issue is I need to display multivalued fields (can be achieved by modifying view column to display new line). Now issue comes when a column value is also multivalued. E.g. first column is created by looping through 50 fields (single value) and second column is created by looping through corresponding 50 fields but these fields are multivalued.
I am looking for ideas about how to nest repeats in this case. Issue is in first repeat I get the handle of documents but in nested one i am not able to get this handle to be able to loop through fields. And it is not simply one column or value I want to display, there are 4-5 such columns.
Any ideas are welcome.
Thanks in advance.
You want to start looking at a repeat control, not a view control. Have the outermost control loop through the entries in the view and populate the data source of a containing panel with a Notes document. Then inside the panel you only refer to the inner document data source.
I am looking for a way to set a list field default value to a property that I have programmatically set on the site where the list resides.
Essentially every item in the list will have the same value which will be hidden from the normal user view. Down stream, I am using a content query web part to pull that field so I can group on it.
I am using SP2013.
Thanks for the help
With Site Properties you mean the SPSite.RootWeb.AllProperties property bag which you have filled with some custom property?
Assuming that is what you are talking about, there are unfortunately no standard ways to work with property bags - besides programming that is.
You said you want to set a default value on a list field for each list item. This sounds like an event receiver! You can choose to have it fire on item updating and/or item created for all your items and always set the hidden field on the item with the value from the site properties.
I have developed a list in SharePoint. While entering new item in it, like name, if I keep on typing it gets spread over a line making the width of cloumn spread over page. I want to limit the width of site column so as the column's value spreads over multiple lines instead of spreading over one. How can I do this setting?
This is not a setting you can configure in SharePoint. You will need to write some custom code using css and possibly javascript that will set the width of the column. You can make a change like this in SharePoint Designer.
You must use min-width (CSS) in your block.
You have to create custom XSLT for this. There you have loop all the column and need to specify the overflow:auto, hidden,.. CSS property. So it automatically get effect based on your internal name of the field.
So whereever you have the field it automatically get affected. If it for one single view you can use JavaScript to achieve this but this is not right way to do.
The data you are entering can be displayed in many ways. Today in a table format, tomorrow in a dropdown etc. You should distinguish between:
limiting the amount of data that can be entered in a site column (can be done in SharePoint alone, when you design your list)
limiting the wrapping of the words in a table cell today or trimming the values in a dropdown tomorrow (can be done using HTML/CSS "nowrap" if you display the list values in a browser app, or differently if you show the values in a WinForms app)
I have a custom publishing page layout I have created. The content type behind the page layout has a lookup column pointing to a document library where I store images. Basically, the pages I am creating from the layout are 'articles' and I have an associated image with each.
As you can probably guess by now, I want to display the lookup image on the page. However, I cannot for the life of me figure out how to do this. I have been inserting columns into the page layout via controls, but I'm not sure how to format it to look at the source document behind the lookup column. I am wondering if it is possible somehow through controls, and if not this way, if it can be done through modifying the XSL of a webpart. My last option which I don't want to use but I know it would work is a workflow (on new item creation, copy Name (FileLeafRef) into a hidden single line text field I coult utilize).
Does anyone know how to format a lookup column to display Name (FileLeafRef)?
Help is greatly appreciated!
-Josh
I`v added a hyperlink (SPFieldUrl class) column (field) with GUI to my list.
Pity, but I cannot filter those values when viewing the list.
alt text http://img5.imageshack.us/img5/5126/ss20090505152613.png
(It reads that you cannot filter this column type)
Is there any way to have it easy filterable with clicking on columns besides creating a custom view?
Thank you.
Depending on how you are using the url, you may be able to do something with calculated columns.
Another option is to use a text field rather than a url field - The url field type is effectively a combination of two fields, so you may be able to get what you are looking for by creating those two field seperately.