Thursday 6 July 2017

To check Sitecore item has presentation or not?

To do this from code behind,
First we should aware of that SitecoreItem should be of Page Template type Item, because Presentation generally applied on Page Item.
And Second thing is Page Template Item should have Standard Value So that in future If you are going to create a Page related to that Item then Page will have some default presentation applied from Standard Value.


So For Now we are checking only Page have Presentation or not:

private bool HasPresentationDetails(Item item)
{
return item.Fields[Sitecore.FieldIDs.LayoutField] != null
  && !String.IsNullOrEmpty(item.Fields[Sitecore.FieldIDs.LayoutField].Value);
}


It will check the layout field's value of that page Item.
If page item's layout field is not empty then presentation is applied to that Item else not.

Wednesday 22 February 2017

How to upload list of images once by drag & Drop in sitecore

Hi Guys,

From last few days, I was very busy now today I am going to tell even show you something exciting
that you should know if you are wokring with sitecore CMS.

And the thing is when developer/designer/ContentEditors are going to add collection of image at a time then
they face speed issue as well as number of processes to add event.

Let me tell you a scenario like dream where you just drag and drop your all the images and just click on upload.

and that will be uploaded to sitecore specified path without any headache just by on click.







I know you guys are thinking that "IS IT POSSIBLE?"

So i will tell you that yes...

Actually It's sitecore existing functionality only thing is most of the people don't know about it.
Earlier I was also know idea about this but when i was trying to investigate then I found this one.
And I decided to share this one with each and every Sitecore Developer/Designer/Content Editor.


So what you have to do just go to the URL that I mentioned below:


<instance_name>/sitecore/client/Applications/Dialogs/uploadmediaDialog/



then Click on change Destination as per your requirtments.



Once selected then press on Confirm Button.

and now goto your file-system and select all the image that you want to add.



And now drag and drop all of these



now edit their image name, description, Alt Name (if required)
and Click on Upload media(Right Top)



And congrats all the images are now uploaded within fraction of seconds.

Enjoy your Day, Enjoy with Sitecore!!!