Is it possible to remove the name of the list on a SharePoint view-page? - list

I have a SharePoint site with one list with several views. In the top of the view-sites is the name of the list (Tasks) and below the name of the view. Is it possible to get rid of the name of the list (Tasks) and only have the name of the view at the top?
I have tried to edit the webpart and remove the title, but that is the title of the view.

As far as I know each view for a list is its own page. Each of those pages will be referencing the Title of the list. See photo of all the views that this example task list has.
Example of how each view is an aspx page under parent list
You have a couple options.
Through SharePoint designer edit each of the views and remove the references to the task list title.
Add a Code Snippet web part and add css that will hide the Task title on load.
Example of how to place CSS in code snippet web part

Try to use the following script to hide the list name in a view:
<script type="text/javascript">
document.getElementById("DeltaPlaceHolderPageTitleInTitleArea").getElementsByTagName('a')[1].innerHTML="";
</script>

This works for SharePoint 2013:
Add a scripteditor to the page and add the following script
<script language="javascript">
_spBodyOnLoadFunctionNames.push("HideBrandingsuite");
function HideBrandingsuite()
{
document.getElementById('pageTitle').style.visibility = 'hidden';
}
</script>

Related

Emberjs - how to render nested route template without parent route content?

Summary
I want to continue to use nested routes but without displaying top level content when the nested route is accessed. I'm not sure this is possible ?
Detail
Initially my requirement was to to display a list of, eg, foods and offer the user the option to add a food item foods/add . Using the outlet tag at the top of the list template allowed a form to add a food item to become visible at the top of the list, transitioning back to food after the add resulted in the list being displayed without the form.
New Requirement
The requirement has now changed and it's necessary to show the form without the the contents of the list and after a succesful add show the list without any form.
Question
I know I could abandon the sub-routes approach and create a route such as food-add but is there any other way of preserving the sub-route (and the corresponding file structure, which I like) but allow the the template for foods/add to be rendered without the list content ?
Each route has an index template which is only visible when a child route is not present.
You could do something like this:
index.hbs
{{#each foods as |food|}}
{{food}}
{{/each}}
<LinkTo #route="food.add">Add</LinkTo>
food/add.hbs
<form>
...
</form>
{{!-- submitting this form would add the new food to the list of foods
and then also transition back to `food` --}}
Here is some more info on how the index route works
https://guides.emberjs.com/release/routing/defining-your-routes/#toc_nested-routes
https://guides.emberjs.com/release/routing/defining-your-routes/#toc_index-routes

Adding a custom widget on all pages in Yesod

I am building a website with Yesod that contains a search form at the top of every page. From what I have understood till now, I should create a widget for the form, but I am unable to include it in a common place. What is the recommended way to do this?
If I create a custom widget, what is the recommended folder structure to follow?
This is what the defaultLayout function is intended for: you can add any kind of content to this page, and all pages of your site which use defaultLayout will inherit it automatically.
I ran into this recently when trying to add a header to every page that has a "Login" link if the user is not authenticated, and a "Logout" link if they are. I didn't find any good examples in the documentation of how to do this so I put one together.
Note: This assumes that you are using the scaffolding, but even if you're not you should still be able to work this in.
The first thing you need to do is create a header widget and add it to defaultLayout in Foundation.hs.
pageHeaderWidget :: Handler Widget
pageHeaderWidget = do
mauthId <- maybeAuthId
return $(widgetFile "header")
defaultLayout widget = do
pageHeader <- pageHeaderWidget >>= widgetToPageContent
-- ...
withUrlRenderer $(hamletFile "template/default-layout-wrapper.hamlet")
Then you need to create the corresponding html and style for your header:
File: header.hamlet
<header>
$maybe authId <- mauthId
Welcome #{show aid} - <a href=#{AuthR LogoutR}> Logout
$nothing
<a href=#{AuthR LoginR}> Login
File: header.lucius
header {
background-color: #007fff;
height: 50px;
}
Finally, you need to edit default-layout-wrapper.hamlet and add
^{pageHead pageHeader}
to the <head> tag just below ^{pageHead pc} (generated by the scaffolding); and replace
<header>
in the <body> with
^{pageBody pageHeader}

CustomItemGenerator and the Page Editor

Sitecore 6.6 Update 4
We're using CustomItemGenerator 1.0 and I was using this to help build a primary navigation menu for a site. This worked as expected and everything was rendered properly.
My problem is when I attempt to edit the menu via Page Editor; I don't even see the menu.
I use a repeater and repeat over a list of links to include in the nav. Due to the way the HTML was created, each LI element needs to have its own, specific ID ("Nav Id" Field in Sitecore) that ties into the CSS. Code inside of my repeater's ItemDataBound event:
// Cast the item using CustomItemGenerator-generated class
GenericContentPageItem navItem = (GenericContentPageItem)e.Item.DataItem;
liMenuItem.ID = navItem.NavId.Rendered; // I tried "navItem.NavId" by itself as well
So while this renders properly in the browser, it doesn't when I'm in Page Editor:
<li id="<input id='fld_B72EB6696DCF41A49671972D5EA5DEB8_2163B90C08AB4A18970A7F3ECE79DCFC_en_1_f71bd37d18d146c19e222e89fcffe278_3' class='scFieldValue' name='fld_B72EB6696DCF41A49671972D5EA5DEB8_2163B90C08AB4A18970A7F3ECE79DCFC_en_1_f71bd37d18d146c19e222e89fcffe278_3' type='hidden' value=" Home?="">
... instead of it rendering like this:
<li id="Home">...</li>
Now, that having been said, I can change my code to not use the CustomItemGenerator and it works fine in the browser and Page Editor as follows:
GenericContentPageItem navItem = (GenericContentPageItem)e.Item.DataItem;
Item nav = Sitecore.Context.Database.GetItem(navItem.ID);
liMenuItem.ID = nav.Fields["Nav Id"].ToString();
I would like to avoid having to hardcode field names in my code, which is why I am using CustomItemGenerator. Is there something that I'm doing wrong with my code that it doesn't want to work in Page Editor?
Thanks!
If you need the actual value out of the field regardless of if you are in the page editor or not, you want to use the Raw property:
liMenuItem.ID = navItem.NavId.Raw;

JQuery - DatePicker not working in popup forms

DatePicker is not working in a popup form, what could I've done wrong?
The form is in a .php format and is triggered by this javascript function below:
function popitup_request(url, ar){
var f = document.forms[0];
if(ar==""){
alert("Please choose at least one record.");
return false;
}
newwindow=window.open(url, 'name', 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,
width=570,height=280');
if (window.focus) {
newwindow.focus()
}
newwindow.moveTo(screen.availWidth/2-(500/2),screen.availHeight/2-(300/2));
}
the form loads but when you click on the icon-trigger nothing happens.
I already tested including the jquery-1.7.1.js on both main.php and popup.php.
I assume you bind the Datepicker widget to the form elements in your main view. Since popup is loaded later (on popitup_request), the date fields on that form will not be bound to datepicker.
Include the datepicker js and css only once, in your main view. Add a small javascript to the bottom of your popup form, something along the lines of
<script type="text/javascript">
$("input.date").datepicker();
</script>
Btw, your code does not reflect best practices in a number of ways (pixel based layout, magic numbers, mixing native Javascript and jQuery though it's not needed). I'd suggest you go through both a Javascript and a jQuery tutorial to see suggested patterns and good examples for enhancing web pages with Javascript.

TinyMCE Custom Tags Rendering

I have add a custom plugin that insert custom tags into my tinyMCE editor of the format:
title
I want the custom tags to be rendered with some styles when viewed in the WYSIWYG view. I have seen one response to a similar question :
http://topsecretproject.finitestatemachine.com/2010/02/how-to-custom-tags-with-tinymce/
but this doesn't work - they tags are not stripped out but they are not styled either??
You need to use the content_css initialisation parameter:
content_css: my_css_file.css
containing something like
title {
// css here
}