What is the alternative for sc:EditFrame in Sitecore MVC - sitecore

The project I'm working on is a new Sitecore 8 site build using MVC and with a demand for page-editor support. The simple fields are being addressed with the FieldRenderer.render() method, but there are also some droplink and multilist fields that need to be available in page editor.
In webforms you could use the sc:editframe control for that, but how can I get the same functionality while using Sitecore MVC?

Just an FYI in Sitecore 8.2 there is support for edit frames:
#using Sitecore.Mvc.Extensions
Then
#using(Html.EditFrame(...)) {...}

If not already, I highly recommend using GlassMapper to map your Sitecoce object to strongly typed objects in your code.
With Glass, you can then use the BeginEditFrame concept to replace the sc:EditFrame functionality of WebForms.
To take it a step further, look to implement edit frame buttons (this link is not Sitecore 8 specific, but the method to implement edit frame buttons is the same) in the core database to allow a very-friendly Experience Editor experience.

Related

Sitecore Glass Mapper - Using Item Renderings

I'm setting up a carousel in Sitecore using Glass Mapper. In the foreach loop to generate each carousel item, I can get the items out easily enough and make them editable with the #Editable command. What this doesn't give, however, is finer control over the edit process. For example, I want to edit the background image using a custom button in the Experience Editor, but I need to set that up in a rendering.
If I was using straight Sitecore, it looks like I'd use Html.Sitecore().ItemRendering and pass in the carousel item as a regular Sitecore item. In this case, I have my strongly-type class from Glass Mapper, which can't be passed in that way.
Is there a comparable method in Glass Mapper for setting up an item rendering? Or is there another way to affect the Experience Editor buttons for the carousel items? I've also experimented with setting up a separate edit mode, which would work fine, but I wanted to put together a cleaner editing experience with a more WYSIWYG approach to the item.
You'll have to use Custom User Experience Buttons which will allow you to edit in Page Editor Mode.
I just googled and found couple of good article which might help you.
http://www.nishtechinc.com/Blog/2015/March/A%20Better%20Approach%20at%20Carousel%20Management
http://www.awareweb.com/awareblog/11-25-14-custombuttonspageeditor
Try Html.Glass().BeginEditFrame() functionality built into Glass Mapper, wrapped in a #using block.
It allows you to specify the fields you wish to edit directly as params. Or if you're feeling adventurous, it can point to a full edit frame configuration in the core DB.

How to add custom menu in Sitecore menu list

i want to add my custom application name in Sitecore Start Menu List, i'm following this article :
Adding Application Shortcut
it saying use Core database i'm using this, i couldn't find Layout studio, can any sitecore developer suggest me how to find this and finish my job. Thanks in advance.
I think the instructions you've linked to there are out of date. I've not seen that bit of UI in recent releases of Sitecore.
Working in Sitecore 6.6 I've successfully made custom applications using these instructions:
http://sdn.sitecore.net/Articles/Customizing%20Sitecore%20Client/Adding%20an%20Application%20Shortcut/Creating%20an%20Application.aspx
But beware the issue that I've blogged about here. The recent revisions of Sitecore subtly break the configuration defined above, and you have to manually edit out a file extension to make everything work:
https://jermdavis.wordpress.com/2014/10/20/a-gotcha-with-custom-applications/
-- Edited to add --
Based on the "it doesn't work in 7.5" comment below, I've tried these instructions on a test instance of Sitecore 7.5 rev 141003. It seems 7.5 behaves slightly differently - but I can still make it work.
Create the item under /sitecore/content/Applications using the external link button for the "Application" field. With raw values displayed, it should look something like:
And then create your application shortcut under /sitecore/content/Documents and settings/All users/Start menu using an internal link for the Application field. I found this still added the '.aspx' extension mentioned in my blog post, but I also found that editing it out again didn't work - it reappeared as soon as I hit save. I needed to edit out the extension from the link data using the Raw Values view in order to get the data shown below:
With those things set up, refreshing the page caused the test item to appear on my start menu:
Hopefully that works for you too?
-- Further edited to add --
New blog post covering this problem in Sitecore 7.5:
https://jermdavis.wordpress.com/2015/01/19/gotchas-with-custom-apps-v2/
Which version of Sitecore are you using? The Layout Studio is probably one of the least features in Sitecore, and personally not something I have ever used.
Instead you should create the the layout in Visual Studio - which then means your layout can be added to your Source Control System. Then follow the instructions in the link in Jeremy's answer.
If you do need to access the Layout Studio for some reason you can find it under: Sitecore menu > Development Tools > Developer Center. From there you can create new files/open existing files.

"there are no allowed placeholders" - why can't I add forms to my presentation?

I'm running Sitecore 7.2 with Web Forms For Marketers 2.4.
I have a placeholder settings main. That placeholder has the WFFM form control listed under "allowed controls". The "restricting placeholders" app also lists the main placeholder as the only selected placeholder.
I have a layout standard that points at a .cshtml file Standard.cshtml.
I have a template standard page. On the __Standard values of that template I've defined a presentation under the "default" device: layout is standard, and the main placeholder is listed under "placeholder settings".
My understanding is that I should be able to "insert form" onto either the __Standard values or on to content item instances of the standard page template. But every time I try either of those I get "there are no allowed placeholders in order to insert a new form". What do I need to do to get WFFM to let me add a form to my items?
WFFM doesn't work with Sitecore MVC. Sad panda.
https://kb.sitecore.net/articles/522918
There are a couple of workarounds floating around (e.g. http://www.chrisvandesteeg.nl/2014/02/11/usercontrol-renderings-in-a-sitecore-mvc-website-wffm-for-mvc/), but I don't think they're supported.
It sounds like you have everything setup correctly in order to insert a form into the main placeholder (possible security issues, notwithstanding). I believe the issue is the fact that the WFFM module is strictly Web Forms only at the moment and does not work with MVC layouts and renderings. Because your layout is a .cshtml file, Sitecore will trigger the MVC pipeline.
Apparently there is an update in the works that will support MVC and possibly support for a wizard / multi-stepped feature.
In the meantime, I have had to work around the issue by creating separate ASPX layouts / templates for form landing pages like the one below. The downside here is that you have to manage separate code paths for both MVC and Web Forms.
https://www.montereybayaquarium.org/support-us/membership/become-a-member-now

Content reuse in Sitecore 7

Currently working in SC7 where I have implemented a kind of scaffolding so that editors can add an article to a page and add sections and paragraphs under it. You get the idea, html5 stuff...
Now, the problem...
Editors are working in Page Editor:
Suppose you make a new page, and add an article. It has a title, hero image on top and an introduction. You choose to create new content and I save it in an ItemBucket called ContenStore where I store all my articles, sections, paragraphs... The SC7 way to use the search if they want to re-use any of that content.
Suppose my editor creates another new page, and he wants to re-use a section from the content store. He will find the section but when he has placed it on the page, non of the paragraphs that were on the original section show up... Of course not, since I guess the layout details are saved on the context item level and not on that section level...
Has anyone tackled this problem before? A sublayout (or rendering) should be able to remeber what layout details it has, so that if you re-use it, all the items it had originally are put in its placeholders again as well, and this recursively of course...
Any thoughts welcome...
Erwin
The problem you describe is not new to Sitecore 7. You would have the same problem in Sitecore 6, you would just have to go through the additional effort of keeping your content organized. This is a fundamental limitation of Sitecore's presentation framework.
I have worked around similar problems before by using Presentation Inversion of Control. (I should probably write an update for that since the rules engine approach no longer works)
I believe that Cognifide is doing something similar with the "Composites" in their Zen Garden, but instead of using a dummy layout they use an empty layout so any item can be opened as a page. Then they added a custom experience button which navigates to that non-page content item within the page editor. (Note that this is speculation based on a brief demo that I saw).
Thomas Eldblom also blogged years ago about what he called Composite Layouts. It's similar to PIoC, but puts the presentation settings on a special rendering type.
In short, there are ways to achieve what you want, but they all involve custom development and will require extra attention to maintain a smooth page editor experience.

Sitecore Create a custom control for content editor

I need to create a custom composite control for Sitecore content editor.
(I m using Sitecore 6.5)
I do not have any experience with IFrame or Custom controls
e.g.I want to implement two drop down controls, lable etc. where content authors can store values and save.
What is the best approach?
I could not find a good example which explains my scenario.
In IFrame, can we populate a layout or a sublayout? We can give external links, but it does not work for internal layouts. (If this is possible it solves half of the problem)
Or else, How can I create a custom control and integrate it with Sitecore?
Or are there any better options to achive this, Please help!
Thanks.
I have figured out the way to tackle this scenario,It's "IFrame".
I need to set the URL of my custom aspx page as the "source", good news is that Sitecore passes few parameters (itemid, language and version) to the IFrame (aspx page), so that I can use those parameters and handle data.