The custom layout isn't loading automatically - ihp

I have created a custom layout in Layout.hs. This is applied to a reporting page that has a different styling (CSS) and JS from the rest of the application.
The report page is accessed via link in the application.
The problem is that when landing on the report page the custom layout (CSS and JS) isn't applied automatically. It only kicks in after a manual refresh.
Any ideas how to fix this?

Related

Is there a way to create tabs and mark selected tab based on page loaded in spartacus

I am using spartacus framework for storefront. I want to show tabs in my application and load pages based on selected tab. Is there any existing cms component or configuratio with which we can do or can i extent the cmscategorynavigation component and customize?
The CMSTabParagraphContainer is used on the product details page to display tabs. A CMSTabParagraphContainer can contain SimpleCMSComponents but not for example ContentPages. You would have to extend the CMSTabParagraphContainer on the backend to also accept ContentPages, ProductPages etc. and then extend the frontend components as well. To extend Spartacus components have a look at: https://sap.github.io/spartacus-docs/customizing-cms-components/
To be honest: This seems like a lot of work if you just want a visual change to the navigation

Removing Ektron widget

I believe there is a widget on my page that is causing unbelievably slow page loads. I have narrowed down the exact page it is, and I have about 8 widgets on it. I am trying to disable the widgets one by one, but am having a tough time figuring it out. In the documentation to explains how to remove a widget, but I would like to only temporarily disable them.
These widgets are on PageBuilders, and I have tried to deselect them in Settings > Configuration > Template Configuration but this does not seem to disable it.
Is there a different way to disable widgets?
I am using Ektron 8.6.1
To disable the widget, you could remove the .ascx file from the /widgets folder. The Page should open but report "Cannot load widget" where that widget would appear on the page.
The template configuration setting only prevents you from adding that widget to a new page.

ViewStateException - Validation of viewstate MAC failed - Sitefinity ASP.NET MVC with Jquery Mobile

I am getting this error most of the time when I submit my form. I am using Sitefinity 6.2 with ASP.NET MVC 4.0 and JQuery Mobile.
As I have Sitefinity in Hybred mode I am using the #Html.BeginFormSitefinity() command to create the form. On the Controller I have my action with the [HttpPost] attribute. The code always hits my default action on the controller with no problem. No matter what I put in the form when I submit I only get an error message on the page...never hits the HttpPost action.
I've looked around and there are many pages with fixes for the MAC failed issue, but none are working for me. I have a machine key in the web.config and I am NOT going to set enableViewStateMac to false as that is a security hole.
OK I tried working with both of the below solutions but they are both really bad. Here is what I am doing now, which is still not great, but I have Sitefinity, MVC, and JQuery Mobile all on the same page and forms are not giving me View State Exceptions anymore.
First thing is that adding data-ajax="false" is not enough, for this to work you need to disable Ajax before JQuery Mobile starts. So, to do this you need to add in this script BEFORE the JQuery Mobile File loads but after the JQuery file loads.
$(document).bind("mobileinit", function () { $.mobile.ajaxEnabled = false; });
After doing this I then do not use the Sitefinity Begin Form, I just JQuery to change the form on the main page to have the correct action.
<script>
$("#aspnetForm").attr("action", "Home/Login");
</script>
Together this means that there is a complete page load for each page change, and form posts use the form declared in my WebForms Master Page.
-Old Answer -
Actually...what I have below is not working. What I am
currently doing is really ugly but is usually working.
As long as the user enters the site from the home page then the home
page is the Jquery Mobile first page. The view state errors that I
was getting was because it saw the current page as the first page and
the form submit was to the active page. What if the controller for
the home page was just set to handle ALL HTTPPost calls? I have
removed the #Html.BeginFormSitefinity() from all the views with forms
and am just using the form on my top level masterpage. Then I add in
code on the view to change the action of this form to point to the
main page controller. ex
<script>
$("#aspnetForm").attr("action", "Home/Login");
</script>
Once I made this change the forms are not throwing view state
exceptions...as long as the home page is the Jquery Mobile first page.
If the user comes in from a different page then all is scrambled.
Don't have an answer for that yet.
Really Old Answer -
OK, think I have found it. I read somewhere, lost the link now, a
list of issues that can cause the error message. One of them is the
form being submitted from a different page.
I looked at the error message I was getting with Fiddler and noticed
that the Referer was my home page but the URL of the form post was the
URL for the page with my form. In stead of browsing through my site
to the page with the form I typed the URL in the address bar. I tried
submitting my form again and now it works!
So, this is an issue of Sitefinity and JQuery Mobile fighting it out.
When asp.net MVC is run in Hybred mode in Sitefinity it is actually
run in a Web.Forms master page that contains a form. When you use the
#Html.BeginFormSitefinity() to add a form to the view it is actually
just adding a div and then using AJAX to submit the form on the
Web.Forms master page.
JQuery Mobile loads up the first page that you visit, but later pages
are just injected into the existing page. So, there are multiple
data-role="page" divs loaded up in the DOM, inside of the Sitefinity
Web.Forms Master Page.
This all together is causing the form to post with the URL of the
active data-role="page" but the server sees that it is being refered
from the original page I loaded up. So, if I went to the page with
the form first all would work, start at any other page it does not
work.
Now that I know this I can put in data-ajax="false" on the link to the
page with the form and all looks to be working. This will cause
JQuery Mobile to not inject the target page into the current page but
will load all fresh with the target.
data-ajax="false" is the answer!

CSS automatically disappearing from Content Editor web part

I'm adding some css in content editor web part on my aspx page and css applies well but as soon as I stop editing page css disappears. When I open the web part again I can see empty
<style> </style>
tag. Any idea ?
This page has custom web part and even if I add some inline css to the web part it applies when page loads but disappear when page finish loading..
I'm trying this on Firefox.
Content editor web part does not let you embed style and script elements directly in the page.
Instead, content editor web part lets you link to a css or js source stored in a sharepoint library.
Alternatively, use SharePoint Designer (if installed in your company) to inline style and script.

How to change global navigation of a web page but not the site in SharePoint 2010?

I created a web page with a custom page layout, the site the page is within has global navigation set to "Display the same navigation items as the parent site" and it was all good. I have now got the requirement to change the items in the global navigation for the page but keep the old setting for the site, how can I achieve this?
For a site I can go to site settings -> navigation and change the links as I like but the page is dependent on the site it is within. I don't have to start over and create a new site do I (instead of a simple page)?
Thanks in advance.
Unless you do some kind of trickery (like Javascript embedded in the page) to do otherwise, the navigation settings are shared for all pages within the site.
If you wanted to get rid of global navigation for a particular page, you could customize your master page to put a special CSS class on the element wrapping it, and use some CSS inline on that page (ie. in a content editor webpart) to hide it.