Adding Facebook like button hides other site content - blogengine.net

I am using the latest version of BlogEngine.NET, and I want the share buttons of Facebook, linked in, Google Buzz, etc. to go below the menu, but after adding the Facebook, LinkedIn, and Buzz button code, the content next to it disappears. It seems BlogEngine.NET prevents entering script tags or something so this would be a limiting issue. How can this be fixed?
The code is below, see the BUTTON CODE section.
<code>
<div class="login">
<span runat="server" id="aUser"></span><a runat="server" id="aLogin" />
</div>
<ul>
<li><a1 href="<%=Utils.AbsoluteWebRoot %>" rel="home"><%=Resources.labels.home %></a></li>
<li><a1 href="<%=Utils.AbsoluteWebRoot %>archive.aspx"><%=Resources.labels.archive %></a></li>
<li><a1 href="<%=Utils.AbsoluteWebRoot %>contact.aspx"><%=Resources.labels.contact %></a></li>
<li><img src="<%=Utils.ApplicationRelativeWebRoot %>pics/rssButton.png" alt="Feed" /><%=Resources.labels.subscribe %></li>
<li><%=Resources.labels.filterByApml %></li>
<% if (Utils.IsMobile)
{ %>
<li><blog:MobileThemeSwitch ID="MobileThemeSwitch1" runat="server" /></li>
<%
}
%>
</ul>
</div>
</code>
<!--BUTTON CODE -START-->
<code>
<div id="Div1">
<script src='linkedinurl' type='text/javascript' /> <script data-counter='right' data-url='mysiteurl' type='in/share' />
</div>
</code>
<!--BUTTON CODE -END-->
<code>
<div id="content">
<blog:SearchOnSearch runat="server" MaxResults="3" Headline="You searched for" Text="Here are some results for the search term on this website" />
<asp:ContentPlaceHolder ID="cphBody" runat="server" />
<p id="footer">
Powered by BlogEngine.NET <%=BlogSettings.Instance.Version() %><br />
Theme by Mads Kristensen
</p>
</div>
</code>

You need to encode it:
Like this:
site.master
<div style="float:right; padding-left:10px" class="TwitterButton">
<div>
<a href="http://twitter.com/share" class="twitter-share-button" data-url=
<%=Server.UrlEncode(Post.AbsoluteLink.ToString()) %> data-text="
<%=Server.UrlEncode(Post.Title) %>"> Tweet</a>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript">
</script>
</div>
</div>
The output would look like this:
<div style="float:right; padding-left:10px" class="TwitterButton">
<div>
<a href="http://twitter.com/share" class="twitter-share-button"
data-url="http://www.kbdavis07.bloggersonline.com/post/Using-HitSniffercom-
with-BlogEngineNet.aspx" data-text="Using HitSniffer.com with BlogEngine.Net"
data-count="horizontal">Tweet</a>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript">
</script>
</div>
</div>
This code above is for Twitter, and I don't have a working example of LinkedIn code.
But it should be about the same.

Related

Image not displayed in jsp in Maven Project

I know this question is answered a million times but I have tried every possible suggestion and nothing works. Here is the structure of my project:
I have tried 3 different directories to put my img.jpg, but non of them displays the image
Here is my jsp:
main.jsp
<%# page language="java" contentType="text/html;
charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<title>Home Page</title>
</head>
<body>
<img value="<%=getServletContext().getRealPath("/") %>" src="/webapp/WEB-INF/imags/img.jpg"/>
<br>
<h1>The FoRoom</h1>
<h2>Millions of users communicate everyday</h2>
Log In
<br>
<a href="${pageContext.request.contextPath}/addUser">Sign Up (Add
User)</a>
<br>
<a href="${pageContext.request.contextPath}/logInAsAdmin">Log In as
an Administrator</a>
<br>
</body>
</html>
Here is the 1st comment section:
<!-- 1st comment section -->
<!-- no error with GET!!!
<input type="image" src="C:\Users\MyUser\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\SpringMVC\images\img.jpg">
<input type="image" src="C:/Users/MyUser/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SpringMVC/images/img.jpg" >
<input type="image" src="< %=getServletContext().getRealPath("/images/img.jpg") %>" value="< %=getServletContext().getRealPath("/") %>">
<input type="image" src="< %=getServletContext().getRealPath("/images/img.jpg") %>" value="< %=getServletContext().getRealPath("/images/img.jpg") %>">
<input type="image" src="< %=getServletContext().getRealPath("/images/img.jpg") %>" value="< %=getServletContext().getRealPath("/images/img.jpg") %>" name="img.jpg">
<input type="image" value="< %=getServletContext().getRealPath("/imags/img.jpg") %>" name="img.jpg">
<input type="image" value="< %=getServletContext().getRealPath("/images/img.jpg") %>" name="img.jpg">
<input type="hidden" value="< %=getServletContext().getRealPath("/imags/img.jpg") %>" name="img.jpg">
<input type="hidden" value="< %=getServletContext().getRealPath("img.jpg") %>" name="img.jpg">
<img value="< %=getServletContext().getRealPath("/") %>" src="/webapp/images/img.jpg"/>
<img value="<%=getServletContext().getRealPath("/imags/img.jpg") %>" name="img.jpg">
<img alt="/src/main/webapp/images/img.jpg" src="/src/main/webapp/images/img.jpg">
<br>
<img alt="/main/webapp/images/img.jpg" src="/main/webapp/images/img.jpg">
<br>
<img alt="/webapp/images/img.jpg" src="/webapp/images/img.jpg">
<br>
<img alt="/webapp/images/img.gif" src="/webapp/images/img.gif">
<img value="< %=getServletContext().getRealPath("/") %>" src="/webapp/images/img.jpg"/>
<tools:img path="/images/img.jpg"/>
<img alt="d" src="< %=request.getContextPath() %>/webapp/images/img.jpg">
<img src="C:/Users/MyUser/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SpringMVC/images/img.jpg" >
<img src="C:\Users\MyUser\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\SpringMVC\images\img.jpg">
<img src="C:\Users\MyUser\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\SpringMVC\images\img.jpg" width="48" height="48">
<c:url value="/imags/img.jpg" var="img" /> (head) , <img src = "/imags/img.jpg" > (body)
<br>
-->
Here is the second comment section:
<!-- 2nd comment section -->
<!-- PROBLEM WITH GET
<img src="<c:url value='./webapp/images/img.jpg' />">
<img alt="<c:url value='/webapp/images/img.jpg' />" src="<c:url value='/webapp/images/img.jpg' />">
<br>
<img src="<c:url value='./images/img.jpg' />">
<img alt="<c:url value='/images/img.jpg' />" src="<c:url value='/images/img.jpg' />">
<img src="<c:url value='images/img.jpg' />">
<img src="<c:url value='/images/img.jpg' />" alt="p">
<br>
<img alt="webapp/images/img.jpg" src="webapp/images/img.jpg"></img>
<img alt="<c:url value='/webapp/images/img.jpg' />" src="<c:url value='webapp/images/img.jpg' />">
<img alt="a" src="< %=request.getContextPath() %>/images/img.jpg">
<img alt="b" src='< %=request.getContextPath() + "/images/img.jpg" %> '>
<img alt="c" src="${pageContext.request.contextPath}/images/img.jpg" />
<img src="${pageContext.servletContext}/images/img.jpg"/>
<img src="${pageContext.servletContext}/webapp/images/img.jpg"/>
<input type="image" src="images/img.jpg" value="< %=getServletContext().getRealPath("/images/img.jpg") %>" name="img.jpg">
<input type="image" src="images/img.jpg" value="< %=getServletContext().getRealPath("/") %>">
-->
In the comments sections is everything I have tried but failed. In the 1st comment section the image is not displayed but no error is shown. When I run my project with a command of the 2nd comment section I get a warning message. For example if I try this:
<img src="<c:url value='./webapp/images/img.jpg' />">
I get this:
[http-nio-8080-exec-4] WARN org.springframework.web.servlet.PageNotFound - No mapping for GET /SpringMVC_Hibernate_Setup/%3Cc:url%20value='./webapp/images/img.jpg'%20/%3E
I have mostly tried to display the img.jpg from the webapp/images. I know that image folder in the WEB-INF is a big NO NO, but at this point I don't know what else to do.
Any help would be very appreciated!!!
EDIT!!!
this is the tutorial I followed: https://www.javaspringclub.com/spring-mvc-hibernate-mysql-example/
I made some changes, but the core is the same.

Spring: Not display image in thymeleaf

I'm doing Spring project use Spring Boot, Spring MVC, Spring Data. Now I have a problem maybe with thymeleaf
This is my index page
Logo Bonfire and room picture is image and save in folder src/main/resource/static/images in eclipse .
When I use Search function, it will display Search page like this picture
I don't know why it's not display logo image and room image although I use one template for my index page and search page... And it's still happened with detail page too, images is not displayed. Only index page displayed images
I think the problem is not by code... I don't know why
This is my room.html (index page and search page)
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="Header :: head">
</head>
<body>
<div th:replace="Header :: header" class="header"></div>
<div class="container">
<div class="products">
<h2 class=" products-in">AVAILABLE ROOM</h2>
<div class=" top-products">
<span th:each="room,iterStat : ${room}">
<div class="col-md-3 md-col">
<div class="col-md">
<a th:href="#{/room/{id}/detail(id=${room.id})}" class="compare-in"><img th:src="#{'images/'+${room.image}}" alt="" />
</a>
<div class="top-content">
<h5><a th:href="#{/room/{id}/detail(id=${room.id})}"><tr th:text="${room.name}"></a></h5>
<div class="white">
<a th:href="#{/room/{id}/book(id=${room.id})}" class="hvr-shutter-in-vertical hvr-shutter-in-vertical2">BOOK</a>
<p class="dollar"><span class="in-dollar">$</span><span>2</span><span>0</span></p>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
</span>
<div class="clearfix"></div>
</div>
</div>
</div>
<div th:replace="Header :: footer" class="footer"></div>
</body>
</html>
Pleased help me
Use this approach to set the image :--
<div th:style="'background-image:url('+ ${room.image}+');'"></div>
Use something like this.
<img th:src="${'images/'+ room.image}" />

asp conditional include error Microsoft VBScript compilation error '800a0400'

I followed Martha's suggestion here:
if page is default then include if not default then
And I am missing something, as I can't get it to display the slider.
Here is the slider code, and how I am using Martha'e suggestion.
This is the slider (bootstrap carousel) code (to be integrated with Martha's suggestion)
<div class="jumbotron">
<div class="container">
<div class="row fz-slider-wrap">
<div class="col-md-4 fz-slider-caption">
DFD Fioriere
</div>
<div class="col-md-8 fz-slider-image">
<div id="fz-gallery-slider" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#fz-gallery-slider" data-slide-to="0" class="active"></li>
<li data-target="#fz-gallery-slider" data-slide-to="1"></li>
<li data-target="#fz-gallery-slider" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img class="fz-img-box" src="images/slider/03.jpg" alt="slider 1" />
</div>
<div class="item">
<img class="fz-img-box" src="images/slider/01.jpg" alt="slider 2" />
</div>
<div class="item">
<img class="fz-img-box" src="images//slider/06.jpg" alt="slider 3" />
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- .jumbotron -->
This is what happens:
If I put the above code inside
<%
Sub DisplaySlider()
slider code
%>
<%
End Sub
%>
I get this error when loading default.asp
Microsoft VBScript compilation error '800a0400'
Expected statement
/afz_includes/jumbotron.asp, line 3
If I wrap slider code in ' I get same error but line 4
If I wrap slider code in " I get same error (line 3)
I also tried to wrap each line of slider code with ", and chnaged the " of classes and ids to ', but keep getting th error.
Here is what I put on the default.asp, and the other pages
<!-- #include virtual="/afz_includes/slider.html" -->
<%
scriptname = Request.ServerVariables("Script_Name")
If InStr(scriptname, "default.asp") > 0 Then
DisplaySlider
Else
Response.Write "<div class='fz-v-spacer-top'></div>"
End If
%>
I am not sure if it was a typo, anyhow I tried to save the slider both as html, and asp, but same error.
It looks like you've put the slider's code inside the ASP code delimiters (the <% and %>), so the compiler is trying to treat it as VBScript, which it obviously isn't.
In ASP classic, you put your server-side VBScript code inside <% %> blocks. HTML code does not go inside those blocks, unless you're Response.Write-ing it.
<%
Sub DisplaySlider()
%>
<div class="jumbotron">
<div class="container">
...
</div>
</div><!-- .jumbotron -->
<%
End Sub
%>

Integrate Javascript to my Rhodes App

in my application. js is a function named
function helloWorld() {}
what should I do to call this function on an index.erb of a model?
I try to write the function in the application.js
$("#changePanel").click(function() {
var data = "foobar";
$("#panel").hide().html(data).fadeIn('fast');
});
then I change my layout erb. at the following content
<% if System::get_property('platform') == 'APPLE' || System::get_property('platform') == 'ANDROID' || System::get_property('platform') == 'WP7' || is_bb6 || System::get_property('webview_framework') =~ /^WEBKIT/ %>
<script src="/public/js/application.js" type="text/javascript"></script>
<script src="/public/jquery/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="/public/jquery/jquery.json-2.3.min.js" type="text/javascript"></script>
and in my view i added
<div data-role="page">
<div data-role="header" data-position="inline">
<h1>Model001s</h1>
<a href="<%= Rho::RhoConfig.start_path %>" class="ui-btn-left" data-icon="home" data-direction="reverse" <%= "data-ajax='false'" if is_bb6 %>>
Home
</a>
<a href="<%= url_for :action => :new %>" class="ui-btn-right" data-icon="plus">
New
</a>
</div>
<div id="panel">test data</div>
<input id="incre" value="Change Panel" type="button"> </div>
</div>
I donĀ“t know whats wrong. Please help me
I don't see any #changePanel for your click event to trigger.
I think maybe you should change:
<input id="incre" value="Change Panel" type="button"> </div>
to
<input id="changePanel" value="Change Panel" type="button"> </div>

can't display an image

I put an image in both folder:
/Views/Home/chart02.jpg and /Content/chart02.jpg
In the view file index.cshtml:
#{
ViewBag.Title = "Home Page";
}
<h2>#ViewBag.Message</h2>
<p>
To learn more about ASP.NET MVC visit http://asp.net/mvc.
<img src="<%= #Url.Content("~/Content/chart02.jpg") %>" />
<img src="<%= Url.Content("~/Content/chart02.jpg") %>" />
<img src="<%= Url.Content("~")%>/Content/chart02.jpg"/>
<%= Url.Content("~/Home/chart02.jpg") %>
</p>
But none of them works.
In the View Page Source:
<p>
To learn more about ASP.NET MVC visit http://asp.net/mvc.
<img src="<%= /Content/chart02.jpg %>" />
<img src="<%= Url.Content("~/Content/chart02.jpg") %>" />
<img src="<%= Url.Content("~")%>/Content/chart02.jpg"/>
<%= Url.Content("~/Home/chart02.jpg") %>
</p>
Do I miss something somewhere?
You have a mix of Razor and WebForms. Your markup should looks like:
<img src="#Url.Content("~/Content/chart02.jpg")" />
Edited now that you're post is cleaned up and your code is showing properly:
In each one of your image tags, you have a slight error. If you're using MVC 3 and Razor, you don't use <%= %> anymore. Just prefix the code with #.
<img src="#Url.Content("~/Content/chart02.jpg")">
or, depending on your version of MVC, you can skip the Url.Content
<img src="~/Content/chart02.jpg">

Resources