I need to use editframe to let the front user to modify some checkbox fields
I create a new edit frame button and set only those fields that I want front user to edit. For example : Core DB -> /sitecore/content/Applications/WebEdit/Edit Frame Buttons/(edit button folder)/(field editor button). In the fields to be edited by front user, I have set it to Headline.
In my sublayout, I have this code
<sc:EditFrame ID="EditField" runat="server" Buttons="/sitecore/content/Applications/WebEdit/Edit Frame Buttons/EditFields">
<div id="whatyoumissed">
<asp:ListView ID="ListView1" runat="server">
<LayoutTemplate>
<ul style="list-style-type: none;" >
<asp:PlaceHolder runat="server" ID="itemplaceholder"></asp:PlaceHolder>
</ul>
</LayoutTemplate>
<ItemTemplate>
<li style="float: left;margin-left:20px;">
<sc:FieldRenderer ID="FieldRenderer2" runat="server" FieldName="Headline"
Item="<%# Container.DataItem as Sitecore.Data.Items.Item %>" /> <br />
<sc:FieldRenderer ID="FR3" runat="server" FieldName="cb" Item="<%# Container.DataItem as Sitecore.Data.Items.Item %>" />
</li>
</ItemTemplate>
</asp:ListView>
</div>
</sc:EditFrame>
Code behind
string queryPath = "/bla/bla/bla/bla/bla/bla/bla/bla/bla";
var item = sc.Context.Database.GetItem(queryPath);
var children = item.Children;
ListView1.DataSource = children;
ListView1.DataBind();
When I click on the edit frame in the page editor, the prompted box does not have the field (headline) for me to modify it. Any suggestion?
Answer:
I have google abit of sitecore edit frame datasource and end up with this link
http://blog.jan.hebnes.dk/2011/12/using-sitecore-editframe-with.html
Instead of using the code behind as shown by Martijn Bos, I modify my code from prev to the following.
<asp:ListView ID="ListView1" runat="server">
<LayoutTemplate>
<ul style="list-style-type: none;" >
<asp:PlaceHolder runat="server" ID="itemplaceholder"></asp:PlaceHolder>
</ul>
</LayoutTemplate>
<ItemTemplate>
<sc:EditFrame ID="EditField" runat="server" Buttons="/sitecore/content/Applications/WebEdit/Edit Frame Buttons/EditFields"
DataSource="<%# ((Sitecore.Data.Items.Item)Container.DataItem).Paths.FullPath %>" >
<li style="float: left;margin-left:20px;">
<sc:FieldRenderer ID="FieldRenderer2" runat="server" FieldName="Headline"
Item="<%# Container.DataItem as Sitecore.Data.Items.Item %>" /> <br />
<sc:FieldRenderer ID="FR3" runat="server" FieldName="cb" Item="<%# Container.DataItem as Sitecore.Data.Items.Item %>" />
</li>
</sc:EditFrame>
</ItemTemplate>
</asp:ListView>
Have you tried setting the DatasSource of the Editframe?
e.g. EditField.DataSource = item.Paths.FullPath;
You almost there. Should not use "FullPath". Try this instead
DataSource="<%# ((Sitecore.Data.Items.Item)Container.DataItem).Paths.FullPath %>"
Related
I have a webpart wrapped in a div that has a border applied to it (class="wpz-1"). The border appears on the page regardless if the webpart zone has a webpart in it or not. How can I make the border appear only if the webpart zone has a webpart in it?
<div class="wpz-1">
<div data-name="WebPartZone">
<!--CS: Web Part-->
<!--SPM:<%#Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
<div xmlns:ie="ie">
<!--MS:<WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="x8600600cbb2046468f9615155e5fd921" FrameType="TitleBarOnly" Orientation="Vertical" >-->
<!--MS:<ZoneTemplate>-->
<!--DC: - Web Part -->
<!--ME:</ZoneTemplate>-->
<!--ME:</WebPartPages:WebPartZone>-->
</div>
<!--CE: Web Part-->
</div>
</div>
You could try to change the div attribute based on child elements of your zone(if no webpart in webpart zone, it will not display based on my testing, so check the webpart zone to confirm whether there is webpart inside <div customAttr="customAttr").
Just demo:
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
<style>
.wpz-1{
border:1px fuchsia groove;
}
</style>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(function () {
if ($('div.ms-webpart-zone', 'div[customAttr="customAttr"]').length < 1) {
$('div.wpz-1').removeClass("wpz-1");
}
})
</script>
<WebPartPages:SPProxyWebPartManager runat="server" id="spproxywebpartmanager"></WebPartPages:SPProxyWebPartManager>
<p></p>
<div class="wpz-1">
<div data-name="WebPartZone">
<div customAttr="customAttr" xmlns:ie="ie">
<WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="x8600600cbb2046468f9615155e5fd921" FrameType="TitleBarOnly" Orientation="Vertical" >
<ZoneTemplate>
<!--DC: - Web Part -->
</ZoneTemplate>
</WebPartPages:WebPartZone>
</div>
</div>
</div>
</asp:Content>
I have the following layout
<!-- Page Content -->
<ion-content class="app-page card-list">
<!--
-->
<ion-searchbar
[(ngModel)]="searchinput"
(ionInput)="onInput(search)"
placeholder="Search Contacts" light #search>
</ion-searchbar>
<!-- Refresher -->
<ion-refresher (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="arrow-dropdown"
pullingText="Pull to refresh"
refreshingSpinner="circles"
refreshingText="Refreshing...">
</ion-refresher-content>
</ion-refresher>
<!-- Contact List Start Here -->
<ion-list>
<!-- Foreach Contact in Contacts do -->
<button ion-item *ngFor="let contact of contacts" (click)="getContact(contact.id)" >
<ion-avatar item-left>
<img [src]="_DomSanitizationService.bypassSecurityTrustUrl('data:image/jpg;base64,' + contact.image_small)" *ngIf="contact.image_small"/>
<img src="img/nopic.png" text-center *ngIf="!contact.image_small"/>
</ion-avatar>
<h2>{{contact.name}}{{contact.parent_id? ", " + contact.parent_id[1] : ""}}</h2>
<p><b>Mobile: </b>{{contact.mobile || "" }} <b>Phone: </b>{{contact.phone || "" }} <b>Email: </b>{{contact.email || ""}} </p>
</button>
<button (click)="newContact()" fab fab-bottom fab-right fab-fixed><ion-icon name="add"></ion-icon></button>
<!-- Infinite Scroll -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-list>
</ion-content>
<!-- Add new contact floating button -->
The problem that I face is that when I pull down the refresher, my bottom left floating button does not stay at the bottom.
I've even place the button out of ion-list, it does not help to keep the button at bottom.
You should use FAB outside the ion-content. The best way is create ion-footer and add FAB to it.
<ion-content>
...
</ion-content>
<ion-footer>
<button (click)="newContact()" fab fab-bottom fab-right fab-fixed>
<ion-icon name="add"></ion-icon>
</button>
</ion-footer>
i create new template for j2.5,
i need to add many module only show on home,
now i need to show many module all page without home,
pleas see my code below :
<div class="row" style="margin-top:20px;">
<div class="col-xs-12 co-md-12">
<?php if($this->countModules('adsright')) : ?>
<div class="col-xs-12 col-md-2">
<jdoc:include type="modules" name="adsright" style="custom" />
</div>
<?php endif; ?>
<div class="col-xs-12 col-md-10">
<div class="content">
<jdoc:include type="message" />
<jdoc:include type="component" /> </div></div>
</div>
</div>
when add module to adsright position and unchecked home page,was not show on my content,
how can i solve that ?
please tell me full way for create position conditional.
thanks.
please give some clear description of your problem.
And if you want certain positions and div structure on home page and not require same on inner pages then you can set condition based on this code. I hope this will help.
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'Home page';
}
Could you please provide some working examples for navigation in sitecore using user control instead of xslt rendering since I do not find a good one on sitecore sdn ?
thanks
One example:
http://www.launchsitecore.net/en/about-launch-sitecore/building-the-site/creating-the-site-menu
Markup
<ul class="nav">
<asp:Repeater ID="rptDropDownMenu" runat="server" OnItemDataBound="rptDropDownMenu_ItemDataBound">
<ItemTemplate>
<li id="MenuLi" runat="server">
<asp:HyperLink ID="MenuLink" runat="server">
<asp:Literal ID="MenuText" runat="server" />
</asp:HyperLink>
<asp:PlaceHolder ID="phSubMenu" runat="server" />
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
Code Behind
HomeItem = SiteConfiguration.GetHomeItem();
List<item> nodes = new List<item>();
if (HomeItem["Show Item In Menu"] == "1") nodes.Add(HomeItem);
foreach (Item i in HomeItem.Children)
{
if (SiteConfiguration.DoesItemExistInCurrentLanguage(i) && i["Show Item In Menu"] == "1")
{
nodes.Add(i);
}
}
rptDropDownMenu.DataSource = nodes;
rptDropDownMenu.DataBind();
When I try to execute the below code it gives me the error "There was an error rendering the control. Check to make sure all properties are valid".
Inner repeater works fine inside the tab container. But outer does not allow to have a tab panel within it.
Tab containers are not available in asp.net toolbox and therefore I installed Ajax tool kit and added that to Visual Studio and refer that Assembly as follows.
<%# Register Assembly="AjaxControlToolkit, Version=1.0.11119.25966, Culture=neutral,PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Repeater ID="ProjectRepeater" runat="server">
<ItemTemplate>
<cc1:TabContainer ID="TestTabContainer" runat="server">
<cc1:TabPanel ID="TestTabPanel" HeaderText="technologies" runat="server">
<ContentTemplate>
<asp:Repeater id="SkillsRepeater" runat="server">
<ItemTemplate>
<div class="project-technologies" id="SkillZone" runat="server">
<a id="skill" href='<%# "http://vingo/Pages/projectresults.aspx?k="+DataBinder.Eval(Container.DataItem, "Skill")%>' target="_blank"><%# DataBinder.Eval(Container.DataItem, "Skill")%></a>
</div>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
EDIT: Outer repeater code
<asp:Repeater ID="P" runat="server">
<ItemTemplate>
<cc1:TabContainer ID="TTC" runat="server">
<cc1:TabPanel ID="TTP" HeaderText="t" runat="server">
<ContentTemplate>
<asp:Repeater id="A" runat="server">
<ItemTemplate>
<%--Code--%>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
</ItemTemplate>
</asp:Repeater>
Instead of a asp.nett Repeater I could use the below code and it did the expected work of a asp.net Repeater and flexibility is much higher than when using asp:Repeaters
function JsonPCallBack(result) {
for (var technology in result) {
$('body').append('<div OuterDiv id=OuterDivId><div class=project-technologies id=SkillZone><a id=skill href=http://vingo/Pages/projectresults.aspx?k=' + technology + 'target=_blank></a></div>');
}
}