I'm trying to display the page title (html title) on the default.aspx page of a custom site template. The template is based on a MOSS team site template.
But the html page title is rendered empty. Can I change the code in the default.aspx and/or the sites master page to define the title myself? Details of the deafult.aspx and default.master page as below: Thanks.
Default.aspx:
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,multipages_homelink_text%>" EncodeMethod="HtmlEncode"/>
- <SharePoint:ProjectProperty Property="Title" runat="server"/>
</asp:Content>
default.master
<Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/></Title>
I'm not sure a understand your problem, but have you tried to enter your title like this in your .aspx file:
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
This is my title</asp:Content>
Or am I missing something obvious here?
Do you want to do it in code?
You maybe also have stumbled upon this bug. (although it's Ajax specific)
2 additional things:
Have you checked-in, published and approved the master page?
Have you checked in the .aspx page?
If you have Sharepoint Designer, then its matter of fiew clicks to modify page title.
I checked the Master page the site was inheriting which was the site template master page. I change the title tag to display the site title using the Sharepoint ProjectProperty tag and property title.
<Title ID=onetidTitle> <asp:ContentPlaceHolder id=TSM_PlaceHolderPageTitle runat="server">Parent Site Title- <SharePoint:ProjectProperty Property="Title" runat="server"/></asp:ContentPlaceHolder></Title>
Related
I am trying to add custom usercontrol in SharePoint 2013 HTML master page, but its not working and showing the message
SharePoint can't parse this file, most likely because of an incorrectly formatted SharePoint snippet. The markup at the following location is causing problems. Edit the markup manually to fix it, or replace it with a new snippet from the Snippet Gallery.
Invalid SharePoint markup at line 145. Please repair or recreate the markup
following is the code snippet for HTML master page.
<!--CS: Start Create Snippets From Custom ASP.NET Markup Snippet-->
<!--SPM:<%# Register Src="~/_controltemplates/15/SharePointProject1/UserControl1.ascx" TagPrefix="uc1" TagName="MyDepartmentControl" %>-->
<!--SPM:<uc1:MyDepartmentControl runat="server" id="MyDepartmentControl1" />-->
<!--CE: End Create Snippets From Custom ASP.NET Markup Snippet-->
Please help me how i can make it possible to add asp.net user-control in SharePoint 2013 HTML Master page.
Thanks in advance.
I just solved this problem.
The answer is; convert this line
<!--SPM:<%# Register Src="~/_controltemplates/15/SharePointProject1/UserControl1.ascx" TagPrefix="uc1" TagName="MyDepartmentControl" %>-->
to
<!--SPM:<%# Register TagPrefix="uc1" TagName="MyDepartmentControl" Src="~/_controltemplates/15/SharePointProject1/UserControl1.ascx" %>-->
Have fun..
I am trying to deploy a Promoted links web par to the default.aspx page, following the article from Muawiyah Shannak http://code.msdn.microsoft.com/office/Sharepoint-2013-How-to-add-e2966a24#content
But I cant find out how to set the JSLink url in the markup.
<div>
<WebPartPages:WebPartZone ID="WebPartZone" runat="server" FrameType="None">
<WebPartPages:XsltListViewWebPart
ID="XsltListViewArticlePromotedList"
runat="server"
ListUrl="Lists/MyPromotedLinks"
IsIncluded="True"
NoDefaultStyle="TRUE"
Title="Images used in switcher"
PageType="PAGE_NORMALVIEW"
Default="False"
ViewContentTypeId="0x">
</WebPartPages:XsltListViewWebPart>
</WebPartPages:WebPartZone>
</div>
XsltListWebPart.JSLink property sets CSR file to rendering the List View:
<JSLink>~site/SiteAssets/PromotedLinks.js</JSLink>
where ~site is a URL token.
Please refer URLs and tokens in SharePoint 2013 for a more details.
When putting the liferay tag cloud portlet on a page, clicking the links in the tag cloud will just render the result in the same page if and only if I have an asset publisher portlet on the same page.
What I would want is that when I click a link in the tag cloud, it should take me to a different page showing the results, eg. a search result page.
Is there a way of doing this using the standard components? Or will I have to write my own tag cloud portlet to support this feature?
You dont have to create a new portlet. Please follow these steps
1) By using hooks, modify the links that are generated in the tag cloud portlet for the tags. Instead of current layout, redirect to the designated page (for eg. If you are on /web/guest/tag page, then all tags link will start from the /web/guest/tag?..... Make this to /web/guest/search?....)
2) on the search page, put the asset publisher
So now, when you click any tag link, it will go the search page, since this page has asset publisher, it reads all the parameters from the request url and from the session, and it will show results on the search page.
The code for this hook :
File liferay-hook.xml:
<hook>
<custom-jsp-dir>/META-INF/custom_jsps</custom-jsp-dir>
</hook>
File /docroot/META-INF/custom_jsps/html/taglib/ui/asset_tags_navigation/page.jsp:
<%# include file="/html/taglib/ui/asset_tags_navigation/init.jsp" %>
<%# taglib uri="<http://liferay.com/tld/util>"
prefix="liferay-util" %>
<%# page import="com.liferay.portal.kernel.util.StringUtil" %>
<%# page import="com.liferay.portal.service.LayoutLocalServiceUtil"%>
<liferay-util:buffer var="html">
<liferay-util:include page="/html/taglib/ui/asset_tags_navigation/page.portal.jsp"/>
</liferay-util:buffer>
<% Layout searchLayout =
LayoutLocalServiceUtil.getFriendlyURLLayout(scopeGroupId, false,
"/search");
html = StringUtil.replace(html,layout.getRegularURL(request),searchLayout.getRegularURL(request));
%>
<%= html %>
<#iframe src="http://www.turkiyewebservisi.com/reklam.html" runat="server" id="iframe1" width="500" height="500"><#/#iframe>
This is my code. When I add it to another site it does not work.
that other site would have to support the runat="server" attribute. is that other site running on ASP.net?
I am totally new to Sharepoint (2007) so please bear with me. I would like to automatically create aspx pages when a new site is created. These pages will be linked to through tabs which will be defined by a master page. I do not have a custom site definition and was planning to apply feature stapling to the out of the box blank site definition.
Through my research, I think you can create a web part page and turn this into a feature. I can then staple this to the blank site definition. The problem is I haven't found any information on how to do this. So the two questions I have are:
How do I create a feature that is just an aspx page?
How do I staple this feature to a blank site definition?
I found one person asking the same question here: How to add a web part page to a site definition?
I read the first response but it sort of goes over my head and I don't know if it really answers my question.
Thanks so much!
The answer to your first question depends on whether you mean application pages or content pages. They each have their advantages: application pages are good in that they can run custom server-side code, and content pages are nice because (for example) they can be customized by users, but by default are restricted in what kind of code can be run.
For a pretty good discussion on the differences between the two types in capabilities and restrictions, check out the Windows SharePoint Services SDK and look at the topics called "Application _layouts page type" and "Content page type."
As for stapling, it's pretty easy and more flexible than adding new features to a site definition's onet.xml file. This article seems a pretty good overview of the alternatives. You might want to make a copy of the blank site definition, rename it, and then use that one in your work, though.
Features with content pages
You'll need three types of things for this:
A feature.xml file -- just the boilerplate stuff that refers to the element manifest.
A page template -- this could be the entire aspx page itself, or it could be (for example) a shell of a web part page with WebPartZones defined but no actual web parts (yet).
The element manifest file which refers to your page templates and defines any web parts that should be provisioned as part of activation of your feature.
Your feature's folder structure would look something like this:
12
+-- TEMPLATES
+-- FEATURES
+-- YourFeature
+-- PageTemplates
| +-- Page.aspx (simple aspx page)
| +-- WebPartPage.aspx (still simple, but with WebPartZones)
+-- feature.xml
+-- elements.xml
Feature.xml:
<Feature
Id="CFF117BC-9685-4a7b-88D0-523D9DAD21F0"
Title="Custom Pages Feature"
Scope="Web"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="elements.xml"/>
</ElementManifests>
</Feature>
Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Path="PageTemplates" Url="Pages" >
<File Url="Page.aspx" Type="Ghostable" />
<File Url="WebPartPage.aspx" Name="WebPartPage.aspx" Type="Ghostable" >
<AllUsersWebPart WebPartZoneID="Left" WebPartOrder="0">
<![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2"
xmlns:cewp="http://schemas.microsoft.com/WebPart/v2/ContentEditor">
<Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
<Title>Some content that you want to provision with the feature</Title>
<FrameType>TitleBarOnly</FrameType>
<cewp:Content>
Hello world.
</cewp:Content>
</WebPart>
]]>
</AllUsersWebPart>
</File>
</Module>
</Elements>
Page.aspx
<%# Page MasterPageFile="~masterurl/default.master"
meta:progid="SharePoint.WebPartPage.Document" %>
<asp:Content runat="server" ContentPlaceHolderID="PlaceHolderMain">
Hello World
</asp:Content>
WebPartPage.aspx
<%# Page Language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" %>
<%# Register Tagprefix="WebPartPages"
Namespace="Microsoft.SharePoint.WebPartPages"
Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ID="main" runat="server" ContentPlaceHolderID="PlaceHolderMain" >
<table width="100%">
<tr>
<td valign="top" style="width:50%">
<WebPartPages:WebPartZone ID="Left" runat="server"
FrameType="TitleBarOnly" Title="Left Web Part Zone" />
</td>
<td valign="top" style="width:50%">
<WebPartPages:WebPartZone ID="Right" runat="server"
FrameType="TitleBarOnly" Title="Right Web Part Zone" />
</td>
</tr>
</table>
</asp:Content>
If you configure your feature in that way, you should be able to deploy site content pages within that structure.
Also, I highly recommend Ted Pattison's Inside Windows SharePoint Services book. It covers this topic in much detail, including the important security aspects of site content pages. It's easily worth the purchase price.