SharePoint 2013 custom navigation - c#

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.

Related

How do I manipulate the default header when creating an asp.net web form?

I am creating a web application using Visual Studio 2015. As per my school instructions, I am using asp.net web forms (with master page in this case).
Before I even get into the actual design and functionality of the web application, the two things I wanted to setup was a bootstrap theme/layout (which I have successfully managed) and also a site wide header and footer.
This is where I am having issues. The application has a default header (a dark bar across the top with saying "Application name" and links "Home ... About ... Contact" and login/register links on the far right. The default footer is a simple "© 2016 - My ASP.NET Application"
My question is where do I go to change these? I want to change the link names, change where the links take you to and remove the login/register links altogether.
I'm really sorry if i'm being completely stupid, I have only previously used Netbeans to write a Java application, meaning this is my first time using C#, ASP.NET and Visual Studio.
Layout information is usually in a master page in a Web Forms project. By default with a new Web Forms site created with Visual Studio 2013 or 2015, this file is Site.Master.
If we take into account a web site setup in Visual Studio 2015 then, In the Solution Explorer, open the master page (probably named Site.master) or if unsure then see the default.aspx page source where you can check the name of the master page in the first line or Page Directive (starts with <%# Page ...) with attribute "MasterPageFile=....".
In the master page, You should find the the following div with the classes assigned
<div class="navbar navbar-inverse navbar-fixed-top">
Inside this div is all the html for the top header bar and you can change the names and url of links and the headings in there.
Hope this helps.

SharePoint open ribbon on page load

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.

Run a aspx page into a Sharepoint folder

I have a aspx page and I'd like to run it into a sharepoint folder. Is there a way to execute this page like a html page? What I really need is to run a c# code that is together the aspx page (code behind) to read a SQLite database and shows the result in a good interface (html-css-javascript).
Obs.: I have a assembly reference for the SQLite.
Thanks a lot!
You need to create an application page inside sharepoint and move your code in that application page. its very simple, please see this link.
http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-create-custom-sharepoint-2010-application-page-using-visual-studio-2010/
Please note that application page only support web forms and not MVC
Not sure "run it into a sharepoint folder" means... You can't have page with code behind in regular SharePoint folders.
You can put ASPX pages (even with codebehind) in Layouts folder on server's disk and they will be avaiable with ....\layouts\your_page.aspx urls.

Add code behind to template in Umbraco

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?

Using Admin Panel How we can create a aspx page in sitefinity?

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

Categories