Sitecore global find and replace path? - sitecore

Is there a way to globally replace a path to an item which has moved? For instance, if I have a module located at home/moldule/oldlocation and I move it to home/module/newlocation but, I know the oldlocation is used in 100 places, can I essentially do a find a replace?

It depends on how the item is being referenced. If those 100+ places reference it as an internal link (from within the WYSIWYG editor), or in reference fields (Treelist, Droplink, Droptree, etc.), then you don't have to find and replace anything. When using these types of links, Sitecore stores the item's GUID, and therefore the paths will be automatically updated when you move the target item.
There are a few cases in which you would need to update the paths, such as using a non-reference based field type (such as a Droplist), an external link entered into the WYSIWYG editor, or in a presentation component's Datasource field. In these cases, you can use the Search and Replace module and/or Sitecore Rocks to handle the searching and replacing.

You might want to have a look at using Sitecore Rocks Search and Replace functionality. You can refine the fields and templates to make the search really targeted.
There are some more details here
http://www.sitecore.net/unitedkingdom/Community/Technical-Blogs/Trevor-Campbell/Posts/2013/02/28-Days-of-Sitecore-Rocks-Hidden-Gems-Part-2.aspx

Related

Scaffolding Components with Insertable Placeholders in Sitecore

I am trying to create a Sitecore site with a main Layout called _Main. The _Main layout has one Placeholder called Content.
I want to allow the author to insert components (Renderings, I guess) into this Placeholder. The components he will be allowed to insert will have names like...
Two_Column_Right
Two_Column_Left
One_Column
These are basically "scaffolding" components which, in turn, will have their own internal placeholders (e.g. RightRail, LeftRail, Center). The author will then be able to insert “real” components into these placeholders.
The goal is to allow the user to dynamically build the layout of the page.
My question is this: Will this work. Has anyone done it before? Will I need to use dynamic placeholders? Will this be possible using the Experience Editor?
Thanks!
This is a very common pattern of 'containers' which should definitely leverage dynamic placeholders. Otherwise, you will get into issues if you have two one-columns on a page and need to have a user add it to the correct one-column container.
So, so to your questions:
Yes it will work.
You should use dynamic placeholders or you will be severely limiting yourself and causing editors issues.
This can be done in Experience Editor, it is just a normal rendering after all.

Sitecore field for selecting multiple files from media library with the ability to upload files

I'm looking for something that allow content editors to select multiple files from the media library, which will be listed in a rendering. They also need to be able upload files and to search. It has to work in the Page Editor (named Experience Editor in version 8).
What I have have considered so far:
A bunch of File fields - but I don't know how many files the editor need to select at most, and having something like 20 similar fields seems bad.
Using a field that supports multiple items like a Treelist with the datasource set to the Media Library allows the user to select files in an acceptable way but not uploading. I tested adding one File field just for the upload function, but was not really satisfied.
Notes:
Currently using Sitecore 7.5 but moving to 8 in a few days, so a solution working in Sitecore 8 is preferred.
I have asked the Sitecore support too and will update here if I get useful answers.
And the winner is.... the answer from Sitecore support:
In the Email Experience Manager module there is a field called "File List".
The image shows the dialog in Sitecore 8 and the field itself (below). It has search, supports multiple files and upload. It stores the value as pipe-separated GUIDs (just as similar fields like Treelist).
The Field Types Module on Sitecore Marketplace includes "Visual List" and "Carousel" custom field types which may provide what you need. I have used this in the past and found it to work well, though I'm not sure if it's compatible with Sitecore 8. As I remember, I don't think they provided the option for uploading new media from the field.
An alternative solution is to use a placeholder and a file component with a DataSource.
Give the component a standard File Field. So upload is possible.
But for every new file the editor must add a new component to the placeholder with the page editor. This is with a lot of files more work for the editor. But a standard solution. (and the ability to personalize the files with the rules engine)

Sitecore Conditional Showing of Fields

So I am rather new to sitecore, and it's a topic that wasn't covered during my training. My questions is just to help point me to the correct term, or documentation on a method to do the following.
I have a definition item, with a ton of field groups, what I want to do is something like:
if Value of Field X is "yes" then collapse/hide Field X or Field Group X.
Does that make sense? Is it a validation rule? or some other kind of rules, is it a workflow I need to attach? Do you place it on just the field I want to hide, or the field that triggers the action?
I appreciate any guidance.
There is nothing out-of-the-box in Sitecore to achieve what you want but there is no reason you cannot create a composite custom field type to do this. The following articles will help you achieve this:
Creating a custom Sitecore Field
Getting to Know Sitecore: Custom Fields, Part 1
Create a new control, inheriting either from Droplist (if the comparison of the value is to be text based) or Droplink (for comparison of ID). You could add a parameter in the Source field of the control to specify what the values that trigger the hide should be.
The underlying control in the Content Editor is just a standard HTML select element. Add onchange events to the control and add your Javascript handler to hide the other controls. Since I could not find a way of adding additional custom css classes to the Sitecore controls, it would be best/easiest to hide all other controls in the same collapsible group after you control. This would mean you would need to group your controls better (or logically at least).
The Javascript will be something like this (the Content Editor uses the Prototype JS framework):
if ($(this).getValue() == 'no') {
// find the parent container of this control and then hide all the next siblings in the same group
$(this).up('.scEditorFieldMarker').nextSiblings('.scEditorFieldMarker').invoke('hide');
}
You can test this by running the above in the console, change out the keyword this with the id of your field, e.g. $('FIELD2292054').
What I am not sure about is how to trigger the hide on initial load, i.e. when someone returns to an existing item, it may be possible by adding to one of the pipelines, but would be better using a JS solution if possible. I'll have a think about this and get a proper code sample up over the next few days.
EDIT: You can add an event handler to sc:contenteditorupdated to handle the content editor being rel-oaded.
document.observe("sc:contenteditorupdated", myFunction);
I wrote up a blog post and put the code on GitHub if you are interested.
Not sure if you have come across Andy Uzick's this blog post.
He wisely talks about hiding fields in the Content Editor and has also created a Sitecore Module called Hide Field Template Extension which is hosted on the Sitecore Marketplace with the full source code to extend.
After reading through and trying the extension, I do feel that it will not completely resolve your issue (how you have described it in the question).
But it will give you:
A mid-term solution to hide a few unnecessary field that some content editors would not like to view.
Fields that are only required by administrators for admin purpose - to de-clutter these fields could be hidden.
Just one thing to bear in mind that it mentions in the requirements Sitecore 6.5 & 6.6. I have not tested it in Sitecore 7. If you are using Sitecore 7, which I think you are, one could modify the source code and make it work for Sitecore 7.
Have a look and share your findings.
Happy Sitecoring!

Assigning Joomla Search Module to Search Specific Pages

On my Joomla site I have a search module that searches through the whole site. I would like to create a user-guide section within my website and add a secondary search function to search ONLY the pages I have created for the user-guide.
I thought maybe I could assign article id's to a search module but I can't see a way to do this.
Any help would be appreciated.
I am not sure if there is a setting for this but I can't remember it being there. You can look for an extension that supports category selection or you can customize the standard module by checking if the results come from a specific category, if not then you don't show them. Hope this gets you on your way.

Search tags/facets in Sitecore Item Buckets

I'm looking to use the Sitecore Item Buckets package from Shared Source since I needed faceted search functionality and it makes sense to use the built in functionality rather than writing by own Lucene.Net search.
Sitecore Item Buckets
I'm having trouble with the search, or maybe I am reading the documentation wrong.
According to the documentation in section 2.2.3 & 3.1.3 I just need to mark a field as "Is Facet" and my filter will show in the search results.
I've also defined a tag field on the template and changed the Tag Parent field in "/sitecore/system/Modules/Item Buckets/Item Buckets Settings" to point to correct folder. This is working correctly, I can apply a set of tags to an item and search from the Bucket UI using "tag:CSharp" and it brings back the correct results, but again there is no filter shown in the list. I've rebuilt the bucket indexes in all cases.
Am I missing something? Should these show up in the list automatically, do I need to change some settings or provide my own implementation?
Screenshot
This is all within the Buckets Client UI, I haven't started writing any code yet, and on a clean install of Sitecore 6.5 (update-5/rev. 120706).
I'm not sure the documentation wording around this is entirely clear at the points I've mentioned. If you read further down the document though, section 4.3:
Item Buckets ships with 5 different types of faceting.
Templates
Fields
Dates
Locations
Authors
If you would like to introduce your own faceting categories then you only need to implement the IFacet interface.
There is an example of IFacet implementation in the documentation, or use dotPeek to look at the implementations of the existing Facets.
You also need to add an item to Sitecore: /sitecore/system/Modules/Item Buckets/Facets