Is it possible to overwrite the Standard Variant in SmartVariantManagement? - odata

I created a smart table using the columns provided by OData service and the corresponding metadata. I also added the smart variant management to the smart table by setting the properties useVariantManagement, useTablePersonalisation and persistencyKey. I can now see the variant management control and create new variants. So far so good.
However, since there is no way to define the column width in the annotation file for the OData service (or is there?), the columns have a predefined width in the standard variant. Therefore, I am resizing the column widths in the afterRendering event of the smart table to consider the length of the data provided by the OData service. The problem I now face is that by resizing the columns, I am adjusting the standard variant and am therefore getting a modified flag (so it says Standard*).
I can see that it is not possible to adjust or delete the standard variant in the frontend but is there any way to save the new layout as the standard variant in the backend?

You can overwrite column widths client side in the XML:
<smartTable:SmartTable entitySet="Setname" ...>
<t:Table alternateRowColors="true" visibleRowCountMode="Auto" selectionMode="MultiToggle">
<t:columns>
<t:Column width="5em" sortProperty="Columnname" filterProperty="Columnname" app:p13nData='\{"columnKey": "Columnname", "leadingProperty": "Columnname"}'>
<t:template>
<Text text="{Columnname}"/>
</t:template>
<Label text="{/#Setname/Columnname/#sap:label}"/>
</t:Column>
...

Related

Grouping and querying content in Umbraco

I am attempting to set up a shared content repository in Umbraco 7. Ideally I would like something like:
ParentGroup
--SubGroup
----contentItem
I would like this structure and then I would like sub sites to be able to pick and choose which content they use, whilst keeping the grouping. I've looked at the multi node tree picker and this looks promising.
I am struggling however with how to organise the content into groups, a group would really be a text label, do I just create a content type without a template for this or is there a better way.
I think creating a document type without a template is the way to go. Every content item in the content tree is defined by it's documenttype and it's perfectly reasonable that not every content item translates directly to a page, thus not having a template.

How to translate non-page content in Kentico

We recently upgraded our Kentico 8.2 instance to 9.0 and are now focusing on localizing our site into two additional cultures. The textual content of our site is primarily stored in one of three places:
Editable regions
Text fields in custom page types
Custom tables
We're using the Kentico EMS license and would like to leverage the built-in Translation Services app in order to translate content in each of these locations, however it appears that it only supports with content within editable regions. I know Kentico has an input control for translating text boxes but it forces the content editor to create a distinct resource key for it; we simply have so much content I'm concerned this will get out of control for editors.
Additionally, we had considered migrating some of our content into pages but they don't logically fit there, and there are some complex relationships that would cause duplicate content so I'd really prefer to keep the content where it is. The other thought I had was to build either a custom module or custom form control to do some dirty work under the covers but didn't want to reinvent the wheel if there was already a known approach.
Is there a Kentico recommended approach, or workaround, to managing content translations within custom tables and page type fields?
You can use Translation in Kentico to translate page type fields and send them for translation. Check this documentation page for an example. It can be more complex at first, but it should do the trick for you. I have just tested creating a simple translation request for my page type and the resulting XLF file contained all page type fields.
For custom tables I will have to dissapoint you because custom tables in Kentico are not culture specific. If performance is important for you the best way to create translations is to add CultureCode field to your table in order to specify which culture the item is for.
For example you can have table with columns: ItemID, Text, CultureCode
And then the data would look like:
1, Dog, en-US
2, Hund, ge-GE
3, Pes, cs-CZ
If you would want to go even step further I would recommend to create this not as a custom table, but as a Custom class which will sit inside a custom module for which you can create your own interface which would allow editors to easily create all culture versions for the items.
For the custom page types and custom tables, you can change those text fields to localized text fields at the field definition and it will allow you to enter different values per language without a resource key. This is the best route IMHO for page types and custom table translation. Although this still does not allow for "automatic" or built-in translation.
I am not sure what do you mean by content translation in page type fields - there is support for translating page type fields. You can find example on sample site in Kentico installation. (The site is called DancingGoat - see image example for page type field localization in english and spanish language).

Google Fusion Table Mapping Help! - Custom Info Window using Closure Templates

First, some background:
I'm working with mapping from Google Fusion Tables and I'm trying to customize the info window using Dynamic Templating, which uses Closure Templates. I'm editing the window from the Configure Map area of my Fusion Table. I'm new to coding and I studied the HOWTO regarding Dynamic Templating here: Tip: Use dynamic templating
The problems:
However when I try to use an example from the HOWTO and adapt it to my own data I am having issues with some data not displaying despite using the correct column name, and I have no idea how to skip blank cells being displayed.
My Objective:
I'm mapping hospitals and nursing homes in the US. My fusion table has some columns that have data which is specific to a hospital and some which is specific to a nursing home in other columns. I just want my info window to display the appropriate data per facility type, which is one of my columns btw.
My Questions:
Am I right to use Closure Templates to customize the data shown in my info windows?
If so, can I specify which columns' data displays in the info window depending upon the facility type?
Hopefully, I've been clear enough for someone to understand what I'm doing/seeing here.
The dynamic templates are the correct choice.
Sample(modify the column-names and facility-types depending on the values used in your table):
{template .contents}
<div>
{if $data.value['facility type'] == 'hospital'}
{$data.value['name of desired column']}
{/if}
{if $data.value['facility type'] == 'nursery home'}
{$data.value['name of another desired column']}
{/if}
</div>
{/template}
so the basic syntax is:
{if $data.value['name of column which should match the condition'] == 'specific value'}
{$data.value['name of column whose value should be printed']}
{/if}

How to associate a single image with a content type in Orchard

This may be a dumb question, but partly for posterity's sake, I want to ask it. I am sure that others who are learning how to use Orchard for the first time will wonder it as well.
I want to create a content type (preferably from within the CMS itself) that has a single image as one of its content parts. The goal is to present users creating a new instance of the content type with a field that includes a single image upload which will be the featured image for that content type. Does that make sense?
There are two fields you can add to your content type that will do this:
Image Field
http://gallery.orchardproject.net/List/Modules/Orchard.Module.Contrib.ImageField
Or
Media Picker Field (included in Orchard 1.6)

Sharepoint Make a custom list read only

I have created a custom list. I am using the same list in sharepoint designer through a page.
I a have a datetime field in the form. I want to make a default current date and time and let it make readonly.
How can I do the same.
thanks
As I understood you, you want to set custom permissions on a date field (column) in a custom list. Sharepoint 2007 does not allow column-level security via the UI as far as I know.
If you deployed the list definition via Feature you can set the site columns to be read-only by setting the field to read only via its column definitions like so:
Hidden="FALSE" ReadOnly="TRUE" Required="FALSE" PITarget="" PrimaryPITarget="" PIAttribute="" PrimaryPIAttribute="" Node=""
An easier solution is to use third party tools such as the Sharepoint Tool Basket. It has a feature called "List Manager" which allows you to set columns to read-only if it's not a system column - see the codeplex site for screenshots.
As for your datetime field having the date of Today, you can just create a new Site Column of type Date/Time and set its default value to be "Today".
So the easiest solution would be: Install the List Manager and activate the feature for your site. Create a new site column "Today" of type Date/Time with default value set to Today. Afterwards set the site column to read-only via the List Manager.

Resources