How to create a “sidebar” in Umbraco CMS?

In Umbraco, each page has a content field that you can edit in the admin area. What I want will be the second content field that I (actually my client, who will edit the content on my own) can edit on each page. Then I would create a main page / template containing two content areas (the first as main content, the second as a sidebar). At least that's what I would do. Is this possible or is there a better approach to have the main content and a separate sidebar on each page?

+3
source share
2 answers

The answer is found, it is very simple: add the property of the text editor to the text page of the runway and make your markup as follows:

<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>

notification <umbraco:Item runat="server" field="sidebarText" />

+1
source

Generally yes.

Add a new tab to the type of document to which you want to add a sidebar (for example, a sidebar or something else). Then add a new property or set of properties for this tab to manage your content.

Then in your templates, just add a sidebar to the layout (and edit the CSS to style the new layout) and add new fields to the template.

In the above case, this line: <umbraco:Item runat="server" field="sidebarText" />

, , . , "sidebarText" , . , , .

- , .

+1

Source: https://habr.com/ru/post/1744198/


All Articles