Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Entity powered Boostrap carousel with ADXStudio and dynamics 365

$
0
0

Hey all,

I am trying to create a client side editable Carousel slider using bootstrap and ADXStudio. I have managed to data drive it successfully creating slides from custom slide entities i have created. the trouble i am having is then getting them to be editable from the client side administration overlay.

I have made sure that the administrator web role has all the access permissions it needs.

I tried wrapping the whole carousel block in to a snippet and modify it using templates instead but that just broke everything.

There doesn't seem to be much in the way of documentation on how to achieve what i am after although i am very close.

In my code behind, i have the following:

protected List<Entity> blurbs = new List<Entity>();
protected void Page_PreRender(object sender, EventArgs e)
        {
            slides = XrmContext.CreateQuery("new_heroslide").Where(x => x.GetAttributeValue<Int32>("new_showslide") == 4).ToList();
        }


And the html looks like the following:

<% if (slides != null && slides.Count > 0)
        { %><div class="container-fluid"><div class="carousel fade-carousel slide xrm-entity xrm-editable" data-ride="carousel" data-interval="4000" id="bs-carousel"><!-- Overlay --><div class="overlay"></div><!-- Indicators --><ol class="carousel-indicators"><% for (int i = 0; i < slides.Count; i++)
                    { %><li data-target="#bs-carousel" data-slide-to="<%: i %>"<% if (i == 0)
                    { %>
                    class="active" <% } %>></li><% } %></ol><!-- Wrapper for slides --><div class="carousel-inner"><% for (int i = 0; i < slides.Count; i++)
                    { %><div class="item slides <% if (i == 0)
                    { %> active <% } %>"><div class="slide-<%: i+1 %>"></div><div class="hero"><hgroup><%: Html.Attribute(XrmContext, slides[i],"new_heading", "text", null, false, "h3", null, false) %><%: Html.Attribute(XrmContext, slides[i],"new_body", "text", null, false, "h6", null, false) %></hgroup><a href="<%: Html.AttributeLiteral(slides[i].GetAttributeValue<string>("new_buttonurl")) %>" class="btn btn-primary btn-lg btn-square"><%: Html.Attribute(XrmContext, slides[i],"new_buttontext", "text", null, false, "div", null, false) %></a></div></div><% } %></div><!-- Left and right controls --><a class="left carousel-control" href="#bs-carousel" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span><span class="sr-only">Previous</span></a><a class="right carousel-control" href="#bs-carousel" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span><span class="sr-only">Next</span></a></div></div><% } %>


As i said previously, i have the entities displaying as slides and the carousel works, I just need to find a way of getting the attributes editable on the client side

Is there material aimed at showing best practice to achieving something similar with being able to edit custom entities from the ADXStudio client administration interface


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>