In Umbraco, every page has a content field that you can edit in the admin-area. What I want would be a second content field that I (actually my customer who will be editing the content by himself) can edit on every page. I would then create a masterpage/template that contains the two content areas (the first one as the main content and the second one as the sidebar). At least this is how I would do it. Is this possible or is there even a better approach for having a main content and a separate sidebar on every page?
Answer found, it is super easy: Add a rich text editor property to the runway text page and have your markup like this:
<table style="font-size: 13px; line-height: 1.5em;">
<tr>
<td class="innerTD">
<div style="min-height:600px; width: 465px;">
<div id="contentHeader">
<h2><umbraco:Item runat="server" field="pageName"/></h2>
</div>
<form id="RunwayMasterForm" runat="server">
<umbraco:Item runat="server" field="bodyText" />
</form>
</div>
</td>
<td style="width: 250px; padding: 8px;">
<umbraco:Item runat="server" field="sidebarText" />
</td>
</tr>
</table>
notice <umbraco:Item runat="server" field="sidebarText" />
Generally, yes.
Add a new tab to the Document Type that you want to add a sidebar to (called Sidebar or something). Then add a new property or set of properties to that tab to manage the content.
Then in your templates simply add the sidebar to the markup (and edit the CSS to style the new markup) and add your new fields to the template.
In the case above it's this line: <umbraco:Item runat="server" field="sidebarText" />
You can also have a default sidebar setting on the home page or any parent item that contains the sidebar info by recursively getting that value. Thus, if the "sidebarText" field on the current page is empty, it would use its parent. That makes managing the content a little easier on a large site and you can change just what you need on the specific page with differences.
The recursive setting is just a check box in the dialog to add an item to a template.
Related
I wrote a Web Application. In which the users can make inputs which will be saved
in a database. (with a [HttpPost] function). From these functions I open other Views. My problm is that althought the Views show up without any problem the path in the link stays the same. This is problematic when I want to go back or I want to copy the link... My idea was to somehow display the link per javascript everytime I load a View but that seems to be a very unprofessional way of doing it.
Simple,
<div class="table-outer">
<table width="50%" align="center" border="1">
<tr>
<td>Column1</td>
<td>Column2</td>
<td>Column3</td>
<td>Column4</td>
</tr>
</table>
</div>
.table-outer{width:100%; background:#ddd;padding:20px}
automatically align center
https://jsfiddle.net/kamatchikumar/3u5qwqms/
After my user adds a new list item with my custom list page, Sharepoint 2007 redirects them to AllItems.aspx. I want them to go the the custom page ThankYou.aspx instead.
My buttos are the standard buttons generated by SharePoint Designer
<table>
<tr>
<td width="99%" class="ms-toolbar" nowrap=""><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td>
<td class="ms-toolbar" nowrap="">
<SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton2"/>
</td>
<td class="ms-separator"> </td>
<td class="ms-toolbar" nowrap="" align="right">
<SharePoint:GoBackButton runat="server" ControlMode="New" id="gobackbutton2"/>
</td>
</tr>
</table>
I have seen several solutions that require adding 150 lines of JavaScript or changing the underlying SharePoint code, and I just can't believe that is the solution - I think either it is so simple that no one has written about it, or I am using the wrong search term to look for it.
I was just overlooking something simple.
The Source parameter on the form link will change the redirect for you. So if your custom form is at
https://myserver/lists/customadd.aspx
Then you can just add the source parameter and Sharepoint will redirect there on submit:
https://myserver/lists/customadd.aspx?Source=ThankYou.aspx
I'm using the jquery Mobile AutoDivider for a web project of mine and it works great in IE8, but for some reason in Chrome it's not generating the headers for me.
My question is: How exactly does the AutoDivider determine what to make a 'divider'? Is is just the first item within your <li></li>?
Here's my basic HTML structure (it's ultimately placed in a ASP.Net Repeater:
<ul data-role="listview" data-autodividers="true">
<li>
<img src="mySource.jpg" alt="" />
<h3>John Doe</h3>
<p><strong>Company Name Here</strong></p>
<p>User Address</p>
<p class="ui-li-aside">
<strong style="display: none;"><!-- This is what seems to make the headers in IE, placing this right here: -->
Last Name of Employee</strong>
</p>
</li>
</ul>
see the docu http://jquerymobile.com/demos/1.2.0/docs/lists/docs-lists.html
Autodividers
A listview can be configured to automatically generate dividers for its items. This is
done by adding a data-autodividers="true" attribute to any listview.
By default, the text used to create dividers is the uppercased first letter of the
item's text. Alternatively you can specify divider text by setting the > autodividersSelector option on the listview programmatically.
I am designing a page which needs to have boxes (partial views) on both the left and the right side of the main content. The boxes will contain extra information just like on SO. I would like to group the pages, so certain pages will have some boxes, and pages of another group will have other boxes.
I am though in doubt how this is best accomplished in MVC.NET.
I see two options:
1) On every page I include the partial controls I need.
2) Create sub-master pages where I can assign a page to, and which can control which partial views should be shown.
Are there any other ways of doing this, which would be smarter or easier to implement?
Boxes on SO pages are strictly related to content of the page, so I would create one master page with 3 content placeholders (Site.Master):
<asp:ContentPlaceHolder ID="LeftContent" runat="server" />
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
<asp:ContentPlaceHolder ID="RightContent" runat="server" />
If you had some range of functionalities, that have the same boxes, I would create master page for them and place something like (Controller.Master):
<asp:Content runat="server" ContentPlaceHolderID="RightContent">
<% Html.RenderPartial("RelatedTagsInfo", ViewData['RelatedTagsInfoModel']) %>
<% Html.RenderPartial("RelatedQuestionsInfo", ViewData['RelatedQuestionsModel']) %>
<asp:ContentPlaceHolder ID="RightContentSubcontent" runat="server" />
</asp:Content>
Actions using Controller.Master would place additional boxes in RightContentSubcontent.
If boxes are really independent of current page, you can also use RenderAction:
<asp:Content runat="server" ContentPlaceHolderID="RightContent">
<% Html.RenderAction("RelatedTagsInfo", "Question", new { id = Model.Id} ) %>
<% Html.RenderAction("RelatedQuestionsInfo", "Question", new { id = Model.Id} ) %>
<asp:ContentPlaceHolder ID="RightContentSubcontent" runat="server" />
</asp:Content>
RenderAction creates new request to render part of the page. It may be easier to use, but I would use RenderAction for boxes, that do not share any information with the main view (for example if you wanted to display "Clock" box, "Latest downloads" box or "Login" box).
There are many ways to put content into sidebars on pages...
Build different master pages, each containing a different subset of sidebar content. I would use RenderAction for this and not RenderPartial, that way you do not have to worry about having each ActionResult in your MVC Solution be responsible for sending content to these partials.
set up a single RenderAction in the Master page and in the ActionResult for the RenderAction, have it inspect the calling Controller and/or the ActionResult (all contained in the HttpContext). Based on that you can send back content conditionally, and render it in the partial view conditionally.
In the EPiServer file upload dialogue, there is a section for adding meta data to an uploaded file such as Title, Link, Description, Author and Publisher. These form fields are implemented using XForms and configured in FileSummary.config.
The headings for these fields are defined directly in HTML markup containing the XForms controls as in the snippet below.
<tr>
<td class="EP-tableCaptionCell">
<span id="id_field1">Author</span>
</td>
<td valign="top" width="200" height="10">
<xforms:input ref="Author" value="" id="id_field2" size="40" class="commonInput" />
</td>
</tr>
My question is, how can I localise these field captions? In this case it would be Author.
The localisation is working in Japanese in every other section of the file manager driven from the lang xml file, but it seems this part of the file manager works in a totally different way from the rest of the episerver admin and edit.
EPiServer CMS feature XForm is used to render the form used in the upload dialog. You specify the file where the form is loaded from in a tag in web.config or episerver.config.
The file is processed and all xform-tags are replaced with EPiServer Web Controls for XForms. Then Page.ParseControl is used to transform the text into a User Control. This string cannot contain any code, because the ParseControl method never causes compilation but you can use other web controls.
There is only one small extra step. Since the text is converted to an xml document you need to add namespace either to the element itself or the root-tag.
<root ... xmlns:asp="dummy1" > ...
<td class="EP-tableCaptionCell">
<label for="id_field2" id="id_field1" style="margin-bottom: 10px;">
<asp:Label runat="server"
Text="TEST!"/>
<EPiServer:Translate xmlns:EPiServer="dummy2"
runat="server"
Text="/admin/admingroup/addgroup" />
</label>
</td>