Sitecore 9, Cannot get Controller Renderings to Render - sitecore

I'm running into an issue where it seems that Controller Renderings are not being rendered by our install of Sitecore 9. This is on a fresh install of 9. I've gone through tutorials on various sites stepping through the creation of Controller Renderings (in hopes I was doing something wrong), have fiddled around with the Controller name (include just the name, do the whole namespace, do the whole namespace with the assembly after it, etc). I've tried making the Controller inherit from just Controller, tried making it inherit from SitecoreController. I've tried without a view (returning just Content) and with a view. No luck.
What's more, I get no error, which I believe is unexpected. I can put anything I want into the Controller name, any string of garbage text, include this as a control inside a content item placeholder, publish it and I just get a blank screen. I can even revert the site back to where it was before I deployed any development code out to it, in essence returning it to the site provided by SIF and I get no error with my garbage controller rendering.
Has anyone experienced issues with Sitecore 9 and Controller Renderings? At the least, I was assuming I'd at least get thrown some error if I was setting up the rendering wrong.
Any help is appreciated.
Thanks much.

Well. Nevermind. But here's a great and obvious tip for anyone who comes after me. The SIF website sample layout is a webforms layout. Obviously, you cannot just drop a controller rendering or a view rendering into that. You have to drop it into a razor layout as there's no mixing MVC and webforms.
Didn't see it as the sample layout is not in our development project. But also would have loved to get some kind of error.
Stupid mistake. But maybe it'll help somebody else.

Related

Branding Issues - JS Injections

In our attempt to transform our code from FTC to CAM we are facing some minor difficulties from the branding perspective. I’ll briefly elaborate about our scenario below:
In our current FTC implementation we are using both CSS and JS to render the desired UI. References for both the assets are present in the master page and hence get rendered with the HTML
Since it is recommended not to modify the master page when moving to vNext, we decided to go via the custom actions route.
We added custom actions for both CSS and JS to a test site. On browsing to our test site, we found out that the UI was appearing as desired but only with a noticeable lag.
As it appeared, what was happening was that the corev4.css was getting applied and then after around 2 seconds our custom CSS would be applied leading to an unpleasant flickering effect.
I went through a project named Branding.CustomCSS present in the PnP samples which did a similar thing of applying the CSS by rendering link tag via a custom action. In the documentation for that project, it was mentioned that this wasn’t a recommended approach for applying CSS if we are on Office 365 or April 2014 CU on-prem. Instead, the AlternateCSS approach was recommended.
I modified the code to use the AlternateCSS approach for rendering the CSS reference while keeping the custom action for rendering JS reference as it is. That certainly improved the experience.
We still had the JS file though which was manipulating the DOM to achieve the desired look and feel and that was still loading with a delay. We suspect that this is happening because in case of Custom Actions the code to insert JS references runs after the page is loaded. While the JS loads and executes, the UI that is shown meanwhile is without the DOM manipulations and is not what is desired. So the flickering of some components in the page, that the JS is responsible to beautify, is still present. This was not the case in our FTC where there was no noticeable lag.
I required some suggestions as to what approach we should follow so that we can do away with the delay in loading such asset files?
Also, is there an approach that would render JS references along with the HTML and not after page load like it does in case of custom actions?
I too are experiencing this issue. It is a really ordinary user experience. As you said, you can limit it by updating the logo and applying the alternate CSS in the provisioning process, but you still get that noticeable flicker. I have been experimenting with adding ms-hidden to the body tag at the start of the process, then removing it at the end, but it hasn't helped much. I might see about hiding the body from the get-go via the alternate css, then in the injector.js file override that style. Any suggestions from others would be greatly appreciated though. The PnP only has a basic injector scenario where it puts a message in the status area, but that isn't really a realistic scenario.

Custom viewpager tabs with custom view, multiple fragment and layouts

I want to make a viewpager which is just like latest facebook application.
and the problem is with tabs.
however i tried to make it, but i need icons with text in tabs and multiple fragments and layouts associated with it.
two issue occurred when i tried to develop.
1. I compromised with my UI, and tried putting static icons in it, but they don't change on selection and they don't even have badge like in facebook application.
2. when i put that code in my application which i have developed in demo app, it shows error and after researching i found that my application don't have an actionbar. so it was giving error after calling getActionBar.
please someone can provide any example or link to that which can help me.
You can refer to the official solution: http://developer.android.com/training/implementing-navigation/lateral.html
Or try this awsome lib: https://github.com/astuetz/PagerSlidingTabStrip

Sitecore Broken Links and Content Editor Issues

We've been noticing an increase in number of broken links on our sitecore website.
Some it is due to
User Training
Publishing Issues (linked page is not yet published)
Maybe content editor issues
It's been hard to verify some of these but sometimes the link might have the authoring page URL (which means someone didn't follow the SOP), sometimes they have a strange url like /shell/Content Editor/...
So we are trying to proactively fix these before the pages go live.
I had a couple ideas like writing a Handler that would look through all "Rich Text Fields" and looking for inconsistencies (like authoring server URL). Also using a crawler-type of validator could help us (http://home.snafu.de/tilman/xenulink.html#Description) but we were wondering what the community was doing to address this issue.
The "internal link checker" usually works well but doesn't detect many of this erroneous setups (as I believe it sees them as 'external links').
Your input is greatly appreciated!
If you have RichText fields and create internal links, your internal link looks like this in the HTML view: "a href="~/link.aspx?_id=EB3AD128E7BF4F3C9F3812F701D7724E&_z=z" and when you hover with your mouse over it, is show "/Sitecore/Shell/Controls/Rich Text Editor/" before the ~/link.aspx. This is normal behavior. This link is modified to a normal link during rendering of the RTE field.
However, be sure to use the Sitecore controls like to render these RTE fields and to render links. Also using sc:fld() in XSLT instead of sc:field() can create strange links because sc:fld is rendering the raw value of the field.
In all of the Sitecore projects I have been working on, I didn't have much issues with broken links.
There is a known bug with copy-pasting links from a rich text editor, where path info is appended to the link (generating the /shell/Content Editor/ stuff).
Sitecore have a fix for it here:
http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/KnownIssues%20Recommended/Copying%20and%20pasting%20link%20in%20rt%20fields%20may%20break%20the%20link.aspx
I would suggest a new Validation Action added to the workflow command before the items are finalized. Then you could actively stop them from being published and give immediate feedback. If you're not using workflows, you could add a new item level validator, but those often get ignored in my experience -- too many false positives on the existing validators.

Can't get Ember.js to render properties from objects in controller

Total Noob question here. My apologies for the simplicity, and I've skimmed hundreds of Ember-tagged posts here looking for an answer. But it appears to be too primitive for anyone to have bothered asking before...
I'm starting from scratch with Ember. I did Andy Matthews' EmberTweets tutorial, which worked fine. I'm trying to use that as a basis for my first Ember app, which is painfully simple; but I'm stuck on the most basic of steps. I appear to have a functioning controller, and am seemingly adding new objects to it successfully. But I cannot for the life of me get my view to render the properties of those objects. The basic view renders out, but not the data from the controller, which I'm just trying to access with a simple #each. I get no errors in any browser console.
Fiddle is here.
I've tried adding objects to the controller in three different ways in my example, to see if that helps. I can successfully access from the console the properties of the objects by inspecting the content array, or with something like FilterMenus.MenusController.content.objectAt(2).get('menu_name'). Apparently, the data is right where it's supposed to be.
But still nothing appears in my template when I try to render out any of the properties, such as: {{menu_name}}. What am I doing wrong, please?
As stated in the other answers, you have to declare your app as a global variable (by omitting the var).
Besides that, you are not calling this._super() inside your FilterMenus.menusController's init method. This is required to setup the Ember.ArrayController correctly, so modifying the content will work.
Besides these two issues, your code looks fine. Here's a working fiddle: http://jsfiddle.net/pangratz666/HPkHt/.
It seems like Ember's big problem with your code is that your Application is defined as a var so it can't be accessed from the template. Removing the var keyword helped.
For some reason though, that wasn't quite enough and I had to add a
this.set('content', []);
as the first line of your init function to get it to work. I've never had to do this before so I'm not sure if it's jsFiddle doing something. If anyone has some light to shed on this, I'd be keen to hear it.
Try the following:
Remove "var" from FilterMenus declaration:
FilterMenus = Em.Application.create();
Change the implementation of menusController.addMenu to be:
addMenu: function(menu) {
this.content.push(menu);
},
This got me the two menu names to show up after "Select Country" and the explanatory paragraph:
countries
countries2
Ember didn't seem to know what this.pushObject(menu); was. Pushing directly to the controller's content array will always work, though.

Grappelli admin "change_list" columns are not sortable

SOLVED: Has been a bug in grappelli-safe, which is the grappelli fork used for Mezzanine. Should be solved by now.
I have never used grappelli before switching to Mezzanine, so i do not know if this is standard behaviour, but i would be very surprised.
This is what happened: after installing Mezzanine everything worked fine, and Grappelli skinned my admin nicely. A few hours later i realized i could not use the column header row to sort objects by the value of that row. The row headers are only links, that reload the page. I'm pretty sure that these links should be overridden by some javascript to allow sorting, but there is no 404 or other error in retrieving the static files.
If someone could confirm that i'm really hunting a bug that would be great. I would hate to use hours for tracking something that is just normal behaviour. And if someone else knows how to fix that, or what script would be responsible for overriding the links, that would be even better.
I hate not to be more specific, but that's all i have right now... :(
Ah, one more thing:
A bit more specific at least: What i want to do is to click on "Status" to sort by the status column. But "Status" is a link to the current page, and therefore just reloads the page.
This just happened to me: It can also be caused by using django 1.4 with grappelli 2.3.8 (both current in pipi)
See this thread for details:
https://groups.google.com/forum/?fromgroups#!topic/django-grappelli/