Add a new field to Sitecore JSS - sitecore

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.

Related

Add app model in new Page by drop-down select in Django

It is bit complicated so I hope that explain this properly.
I have app which is created within new Page in admin site. In that app I have also drop-down list with my installed apps like on picture.
drop-down of installed apps in new Page
I need someway to add models of selected app dynamicaly by add button at the end of this Page. So if I select app, with add button add model of app below page content, next select second app and add model below app added before. So at the end I will have filled Page with models of apps that I added.
Adding functionality like on this picture or with some add button or add button next to drop-down.
desired functionality
I dont have so much experiences in Django that I can make it self right now. I know that this is possible but I need help of you that you are Django Pro. I really need to make this done.

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

Sitecore Upload Media from Page editor doesn't work

I am a new bee to Sitecore and here comes my first challenge at work.
In one of the website component, I want to add an image.
For this in content editor:
I'll click on browse.
Switch to folder view.
Navigate down to the folder you want to save into.
Click upload media on top left.
Click ‘Browse for media files’ and navigate to the image on the local drive and select it.
Enter alt-text and click upload media.
In Chrome the green bar for uploading never seems to finish. On IE one of the green bars changes to ‘Upload complete’. At this point there is no call to action to add the image to the module, select the module – you just don’t know what to do next.
Eventually you have to click ‘Back’ or ‘close’. Then when you go to find the image it is not in the folder you selected. It is in Upload folder. We cannot keep all of our files in ‘Upload’. We need to be able to upload into a chosen folder.
I am using Sitecore 7.2.
This works properly in a base site in Sitecore 7.2, but is not working in my website.
Is there any setting I need to change to make this work properly?
I know we can add media files into Media library directly and can use it. But we want to do it the using the above mentioned steps/ or using Page editor. The main problem is, this doesn't work while adding image from Page editor.
Hope I can get some solution!
many thanks!
I looked at the Release Notes for Sitecore 7.2 and found that there were several bugs related to Media Uploads that were resolved in Update 2 (140526), including some that relate to choosing the destination of uploaded media. From your description of the issue and the bugs that were fixed in Update 2, it sounds like you may only need to update to Revision 140526.
To find out what revision of Sitecore you are using, go to the Sitecore Desktop -> Start Menu -> Control Panel -> Administration -> Show About Sitecore Information. As you will see in the screenshot, below, there is a parenthesized revision number at the top. If that number is not 140526 then you should try to apply Update 2 to your instance.
Note that this screenshot is of an instance that is not running on Sitecore 7.2 Update 2, but is instead running on the initial release (140228).

Storing multiple images for an item in Sitecore

I want to store multiple images for an item (e.g. images of a building) and I need to create a image viewer control in the ASP.NET website as well.
What are good options to save and retrieve images from Sitecore? If there is an Image list kind of control that would be ideal in my scenario.
Is it a good option to use the "Attachment" field type? If anyone has code examples, please share.
The Sitecore Field Suite open source module contains an "Image Field" control that allows you to attach multiple images to a content item. Unlike a normal multilist, the Image List allows authors to see the images they are attaching directly in the Content Editor, which can be very helpful in choosing and arranging Carousel items.
Links:
Blog post introducting the Field Suite: http://blog.velir.com/index.php/2012/10/24/sitecore-field-suite/
FIeld Suite on Sitecore Marketplace: http://marketplace.sitecore.net/en/Modules/Field_Suite.aspx

Add buttons/dropdownlist to sitecore webedit editor?

Is it possible to add more buttons or a dropdownlist to the webedit editor when you are viewing the page in the page editor in sitecore?
If you look at the image below I would like to add a "H2" button in the toolbar.
You need to add it to /sitecore/system/Settings/Html Editor Profiles/Rich Text Default/WebEdit Buttons/.
And, to create a h2-button, enter the following into the Click field of the new item:
chrome:field:execute({command:"FormatBlock", userInterface:true, value:'h2'})
('h2' being the block format you want)
Yes, that is possible.
You need to modify the Html Editor Profile for this which is located in the Core database under /sitecore/system/Settings/Html Editor Profiles
If you look at the Full profile, you can find a command for H2 (and other headings) there somewhere. This can be easily copied to the profile that you are currently using (i guess it's the Minimal profile).
If you have access to the web.config, you may want to create a copy of the Minimal profile before editing it and configure it as HtmlEditor.DefaultProfile