New custom field doesn't show in web layout and "Enable the new work item form" doesn't show on TFS 2018 Collection Settings - tfs-workitem

In TFS 2018, I am creating a custom template by using the Agile template as the base. I added a new field to the "Task" work item and updated the layout. In Process Template Editor when I use the Preview, it shows my new field. Uploaded the template to TFS 2018. Created a new project using the new template. I am able to see the new field in queries, but on web layout in TFS that custom field doesn't show up. I have checked things like read-only and hide empty settings. I can even import data into this new field using VSTS Sync Migrator and see it in queries. When I open the Task in web layout, it shows all the data other than the new field. When I open a new task to enter data, same thing, the custom field doesn't show.
Given that I am changing the web layout, I see some discussions about "Enable the new work item form" under Collection Settings. I am server admin, collection admin and project admin but "Enable the new work item form" doesn't show. I have tried clearing cache, restarting TFS services but no help. It seems that the new custom field will only display if I activate something.
I tried removing some other standard fields like "Description" from the task in my new Process template web layout for the task workitem and it keeps displaying them in the web layout on TFS. Another proof that the new layout is not taking effect.

Figured it out. I wasn't using the WebLayout tags in the XML file. I was using the Process Template editor which only updates the FORM elements which aren't used in TFS 2018. Had to add my elements to the weblayout section and all worked good.

Related

Add a new field to Sitecore JSS

I created a simple Sitecore JSS Application and imported the same.
In connected mode, I want to add a few new fields. I added them to the template (Image 1) and they show up in the item (Image 2). When I query the item, I get the new fields in the json object as well (Image 4).
However, I cannot see the new fields in the experience editor (Image 3) and I am assuming I need to add those in the View. I am unable to locate where I need to add these fields or what I need to do, to have these show up.
Image 1: The modified template
Image 2: Both description and photo show up in the item
Image 3: Description and photo do not show up in the experience editor
Image 4: Json however returns these 2 properties
The Experience Editor use the Node.js app inside the /dist folder of your Sitecore webroot. (See also the config, you can have multiple apps)
Change your frontend, I Guess you use React, Vue, or Angular and upload/deploy to the dist folder.
You need to choose your dev workflow see:
https://doc.sitecore.com/xp/en/developers/hd/190/sitecore-headless-development/development-workflows.html
When you add your fields in Sitecore, you are using the Sitecore-First Workflow.
Hidden gem:
JSS add a extra Field "Always Display Field Editor Button in Experience Editor" to Renderings. In the Experience editor the Chrome Toolbar from a rendering has as first icon a Pencil, That opens a Field editor for all custom fields.

Sitecore users to add fields to template

I'm building a products table to show all the products attributes. However I need to allow users to add/edit/remove those attributes from the products later on in production without any dev work. I thought about branch templates but when I edit the branch template, existing products are not getting updated. Maybe I'm looking in the wrong direction? Any suggestions?
In an older project we have a similar setup with product and attributes and used a custom database to help us out:
products are stored as items in Sitecore
attributes are stored as items in Sitecore
a custom database stores the values of all attributes for all products
publish events are used to keep the custom database in sync when deleting products
on a product template we added an extra tab in the content editor including an aspx page that offers an editor on our custom database for that product. We use the products Sitecore ID and display all possible attributes in an editable way.
Most attributes have simple string values but that is extendable. Our attributes have a type (string, bool, (multi-)list, ..) and we use that to create the editor. The lists refer back to Sitecore items (a parent is selected on the attribute item).
Adding an extra tab in the editor can be done by creating a new item in the core database (/sitecore/content/Applications/Content Editor/Editors) that point towards your aspx file. In the standard values of your product template, you select the created "editor" in the Appearance section. (note that this is in Sitecore 6 - might have been changed although the path to the editors is still valid)
This solution does mean that the values of your attributes are stored outside Sitecore, but it worked for our requirements.

Sitecore 8: The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel'

I'm randomly getting the following error when I try to login to the Sitecore back end.
The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel', but this dictionary requires a model item of type 'Sitecore.ExperienceAnalytics.Client.Mvc.Presentation.ExperienceAnalyticsLineChartViewModel'.
I experience this issue after I have build the Sitecore link databases using Sitecore Launchpad --> Control Panel --> Rebuild link databases.
When I clear the Sitecore cache using http://{your website}/sitecore/admin/cache.aspx this is error is not throwing for sometime.
Is there anyway to eliminate this error permanently ?
When you Remove Broken Links on the Core database, the Model property of the ExperienceAnalyticsLineChart rendering is erroneously deleted.
Navigate to the Core database in the Content Editor of your Sitecore instance at http://{your-sitecore-url}/sitecore/shell/default.aspx?sc_content=core.
Navigate to the ExperienceAnalyticsLineChart rendering in the item tree at /sitecore/client/Applications/ExperienceAnalytics/Common/Layouts/Renderings/ExperienceAnalyticsLineChart.
Set the Model field to Sitecore.ExperienceAnalytics.Client.Mvc.Presentation.ExperienceAnalyticsLineChartViewModel, Sitecore.ExperienceAnalytics.Client.
Save the item and click OK if prompted that the item contains broken links.
Log back into Sitecore and the Launchpad will load.
In your view you're using Sitecore.ExperienceAnalytics.Client.Mvc.Presentation.ExperienceAnalyticsLineChartViewModel instead of Sitecore.Mvc.Presentation.RenderingModel witch is the default.
If you want to use your own model you have to register it in Sitecore
Navigate to /sitecore/layout/Models and add a new model in the model type add "Sitecore.ExperienceAnalytics.Client.Mvc.Presentation.ExperienceAnalyticsLineChartViewModel, YourAssemblyName"
go to your View rendering item in sitecore and select your model in the Model field.
https://community.sitecore.net/developers/f/8/t/109 looks like they have same issue like you

Bulk Creation Of Items In Sitecore

I am using Sitecore 8, Update 3.
I am attempting to bulk create a couple thousand items that use a custom template. All of these items are created under one specific parent item.
The custom template has two fields which are Path [Single-Line Text] and Target [General Link].
The source of the data is in an old SQL database.
Is there a way to do this?
The Sitecore marketplace module Data Importer is a option for you.
Create a custom importer with the sitecore api is also possible, to speed up, you can disable the index rebuild.
Since your data is already in SQL Serve, you should take a look at using the SSIS Components for Sitecore, it was designed for importing exactly this kind of data in bulk into Sitecore using ETL.
You can find more info in the blog post Creating your first project with SSIS Components for Sitecore and there is also some good additional into in the Migrating to Sitecore: Going from WordPress to Sitecore with SQL Server Integration Services (SSIS) post.
The Integration Services Components for Sitecore is available on the Sitecore Marketplace, and it is compatible with Sitecore XP8.
I'll also add, if you are creating anything more than 100 items below a single parent item then this is not recommended Sitecore practice unless the items sit within an Item Bucket. Make sure you account for this, or split your items up into smaller sub-folders (e.g. year/month folders for news article type items)
In these scenarios you normally end up writing code to call the api and create the items programmatically rather than doing a generic import.
If you need to create a large amount of items I would recommend writing a console app to do this. You could use the Sitecore Item Web api to create items outside of the Sitecore context or investigate the new Entity Service api in Sitecore, both will be capable of creating large amounts of Sitecore items.
http://mikerobbins.co.uk/2015/01/06/entityservice-sitecore-service-client/
https://sdn.sitecore.net/upload/sdn5/modules/sitecore%20item%20web%20api/sitecore_item_web_api_developer_guide_sc65-66-usletter.pdf
If these don't float your boat you could always write async code to create the Sitecore items and have that executed by an aspx page in a Sitecore instance - works well for one off tasks.
Example of Asynchronous page processing in ASP.net webforms (.NET 2.0)

Sitecore: Create component and insert into placeholder on page creation

We have developed a Sitecore site for a client who will primarily be using Page Editor. We've built page type layouts and then componentized everything else, including sub-layouts of content. This allows them the most flexibility when building pages.
So, an author goes to a page selects the main content area (Placeholder) of the page and inserts basic building block components that we've created. These include Rich Text box, page promos, etc. they can use these to build pretty rich pages with lengthy content.
All page components have the same Datasource Location, which is a "Page Components" folder that's setup as an item bucket.
This is all working well so far.
Now, I'm trying to make it so when a page is created a specific component is created, inserted into to our "Page Components" bucket and placed in a specific placeholder on the page.
I've been trying to build a Branch Template to accomplish this, but I don't see how to specify that the new component should be stored in our bucket location, instead of directly underneath the Page item. Also, how to make the component show up in the placeholder that I want on the page.
Is this possible? Thanks in advance for you help!
You will want to use a command template for this, since you are desiring to programmatically bypass Sitecore's standard layout configurations and branch template creation.
On your page template standard values, you will want to add the sublayout to the presentation details so you can hook the datasource in programmatically after creation.
The fundamental flow in the command will be as follows:
Create the desired page item
Create the desired component datasource in the bucket location
Search the layout definition of the created page item to find the appropriate sublayout to bind to.
Alter the datasource on the sublayout to bind to the datasource you created.
As #jammykam mentioned, there is a recent blog post now available.