The problem I'm facing is getting the ribbon to open up automatically when I load a page, say I click on the 'Customer Info' link in the quick launch menu, I'd like the ribbon for the Customer Info page to appear upon loading the page.
We have some javascript that does this on custom pages with webparts, seen below:
<script type="text/javascript">
$(document).ready(function () {
WpClick({
srcElement: $(".s4-wpcell").get(0),
target: $(".s4-wpcell").get(0)
});
$(".item-select").click(function () {
RefreshCommandUI();
});
});
The pages I'm trying to do it on are just your run of the mill SharePoint pages with the 'add new item' link etc. Is there a way to do this through the schema file? Or is there some way to put the javascript code above into the schema file so it does this?
I'm open to suggestions.
Thanks!
I think you have a couple of options.
If you need the ribbon to always be open on page load within that site then put the javascript in your masterpage for that site (this may mean you need to create a custom masterpage deriving from the one you have now that includes this javascript)
If this is on a small number of pages (and the number isn't going to grow in the future) then I would recommend just putting the javascript in a content editor webpart. This can be hard to maintain if you expect this requirement for a lot of newly created pages on the site.
If you need to have the ribbon loaded for a number of page types look into creating custom page layouts for these page types (if you haven't already) and add the javascript to the page layouts you need it for. This may not be a good option if you are working with a bunch of pages that are already created using the out of the box templates as you would need to do some sort of migration to the new page layout.
Related
I am new to ASP.net MVC web development. I created the default MVC application! In the top of the Home page You find Home,About and contact buttons.
But When I checked the index.cshtml I can not find the code for Home,About and contact buttons!
I searched other files in the solution but was very hard to locate them! In which file can I find the code for these buttons?
yes..kushan....that is why it is suggested in mvc that to start with
empty mvc application
instead of going for the ready made template ..
Because by manually creating each part you would learn the use of layout , partialview , how to add scripts & webconfig , startup.cs etc
anyways the corresponding code for your landing page
could be found in the respective controller & views folder
Your looking for asp.net-mvc Layouts.
Excerpt:
Most web apps have a common layout that provides the user with a consistent experience as they navigate from page to page. The layout typically includes common user interface elements such as the app header, navigation or menu elements, and footer.
While adding view to your project it show option to include layout page,
ADD LAYOUT PAGE.
By default c# mvc application contains layout.cshtml page which contain your about, home etc links.
So by enabling layout.cshtml to your page help you out.
If you want to add it manually then create anchor tag to your page which contain 'href' that contain links.Also make methods in controller to handle link clicks.
You can also add your own layout.cshtml page which contain link to your home,about, contact us etc and refer layout.cshml to every other cshtml page.
i am trying to customize sharepoint 2013 navigation. I am following this example:
http://chrisstahl.wordpress.com/2013/12/31/customizing-sharepoint-2013-global-navigation-with-css-and-jquery-part-2/
but the issue is where i would put the repeater control in my master page? sharepoint 2013 only allows editing .html files?
You should be able to edit both the HTML or .master page (though editing the .master is not recommended). Are you able to use the design manager on the site to generate the necessary snippet that you can place in the .html? In the example you linked, it looks like he is using the top navigation. You can do the same for the .html page by generating a snippet for the top navigation and pasting it to where ever you want in your .html master page.
Again, I've looked around to try to find some posts on this and there are many but none that address my specific question (that I could find).
What I am looking : I have a projects and it loads different pages (.aspx) in an iframe dynamically. Now I am trying to remove iframe and add a div and load aspx pages inside that div, using this :
$("#containerDiv").load("test/default.aspx", function () {
});
it loads aspx page easily but I am unable to execute C# code which is written in default.aspx.cs may be its not a good practice but I want to know is there any solution of my problem.
$.load will not your c# code why because it load only the contents of your aspx page not of aspx.cs.
Use user controls instead.
If need help how to implement user control refer this link.
We're adding functionality to an Umbraco site. We do not have access to the c# of the templates and all we can do is create user controls and add them to the pages.
The original developers used the Umbraco UI to do the entire site so all we have access to is the template and its html but not the code behind.
What we now would like to do is add some code into one or two of the existing pages.
Can we do this? Can we add a class file that has a particular namespace etc that will then execute the page_load method when the template starts?
Sorry if I'm being a little vague
You can use masterpage the same way as you would use an aspx file, just create the template pages in the GUI and open the project in visual studio.
To create the codefile there is a utility that will do some of the work for you http://umbracocs.codeplex.com/
The template in Umbraco is really a master page. Umbraco has a single aspx page (default.aspx) that is the entry point for all requests. So you can't add code to a template in the sense you would add it into the code behind of a page.
Can't you just create a user control having the code that you need (no ui) and just add it to the tempate through a macro?
how we can create the dynamic page ex. help.aspx and write the code in sitefinity. Because i facing a problem I create a page but i unable to know in which directory the page is lived. If any one help me Suggest.
http://abc.com/sitefinity/admin/pages.aspx
I'm not exactly sure I understand your question correctly. When you create a page in Sitefinity, it doesn't create an ASPX file. The data for the page is kept in the database and served from there. There are no physical files involved.
If you want to write some code that executes when a page loads, you have two options:
Put the code into a control and drop the control on a page created from within Sitefinity
Create a regular ASPX page from Visual Studio and include it as an external page in Sitefinity.
I would recommend the first option, as this would provide you with all the Sitefinity goodness that all pages use - templates, editing through the browser, etc.
If you wanted something else and I misunderstood, please be more specific.
Slavo, The Sitefinity Team