Bootstrap popover only shows one word of string - django

I have a set of popovers that show supplemental info upon hovering. They display, but only the first word of the string.
template:
<a data-toggle="popover" data-trigger="hover" data-content={{std.Description}} > <i class="fa fa-question"></i></a>
...
$("[data-toggle=popover]").popover();
The field in question is a Django TextField:
Description = models.TextField(blank=True)
Behavior:
This description had several words, but all after the first were cut off.

The solution is the same as for Contain form within a bootstrap popover? , though the title of the post may be misleading. The issue is that there need to be quotes containing the desired variable:
data-content="{{std.Description}}"
Additionally, if you want to include html in the popover (lists, <br>, etc.), include data-html="true".

Related

Bootstrap group list shows text sprites at runtime

The code is listed below, using the bootstrap class class="list-group-item-text".
As the image here shows, the text seems to have a duplicate version just above it - looks almost like dotted lines.
`
<asp:Panel ID="pnlInstructions" runat="server" Visible="true">
<h4>Instructions:</h4>
<div class="form-inline col-lg-12" id="Instructions" style="padding-top:10px;padding-bottom:20px;padding-left:10px;">
<ol class="list-group-item-text" style="text-emphasis:filled;outline:none;">
<li>First, please use MyEd to get your extract file ready.</li>
<li>Then, fill in the following to Log in.</li>
</ol>
</div>
</asp:Panel>
`
I've researched the problem using the word "sprites", but that seems to have a different meaning than I expected, since I thought it meant "unwanted junk" in a display.
I'm not sure if this appears on all browsers.

django's urlize changing text color of entire string containing url substring

I am loading a long text from a database into a Django template. This string contains a url https://yyyyyy as part of the text. I use django's urlize in order to display the url as actual links, however adding urlize is causing the entire text including the link to change color to blue. Removing the urlize leaves the text as black. I only want the text to be black. How can I stop this color from changing to blue while using urlize?
Here is my implementation :
<p style="font-size: 15px; color: black" class="tm-pt-30">
{{ value.description | safe | urlize }}
</p>
The class tm-pt-30 is only responsible for padding.
#raphael was right. My problem is I had wrapped the entire card containing the code in the question with <a></a> in order to make the whole card clickable. The fix for this was only wrapping the appropriate elements.

Sitecore Web Forms for Marketers, add info to the display-section-legend class

We are on Sitecore 8 using Web Forms for Marketers.
I am trying to identify how to add information to the "display-section-info" class item in a sitecore WFFM form. Looking # The generated code I see an element (display-section-info class) after the Field Legend, and before the starts of our fields. I would like to put some basic information regarding the fields in this element (below has text "THIS IS WHERE I WOULD LIKE TO ADD TEXT").
Here is the source from "View Source" on the browser. Through developer tools I plugged in some info and that is exactly where I want it to go.
<fieldset class="display-section-fieldset">
<legend class="display-section-legend">1. OUTSIDE INTEREST:</legend>
<p class="display-section-info">THIS IS WHERE I WOULD LIKE TO ADD TEXT</p>
<div class="display-section-content">
<div class=" field-border">
<span class=" field-title">
<span class=" field-required">*</span>
In the field below, list exceptions
</span>
Update1:
per Jammycans response I added a few parameters to the section but did not seem to display. items have been published, I also confirmed on the prod DB.
Content Editor
Results:
Thanks in advance
There is no field in the Form Editor to set this information, you can set it directly on the section item itself.
In the Content Editor, expand the form and select the Form Section item. On the section item in the Parameters field set the information field text you need:
<Information>THIS IS WHERE I WOULD LIKE TO ADD TEXT</Information>
You can use the Localized Parameters field if you need to translate the text.
EDIT:
There is a bug in the logic on the default WFFM section view, located in \Views\Form\EditorTemplates\SectionModel.cshtml (for Sitecore 8 update 5 and earlier). On lines 18-21, the code reads:
#if (string.IsNullOrEmpty(Model.Information))
{
<p class="#Model.CssClass display-section-info">#Html.Sitecore().Field("Information", Model.InnerItem)</p>
}
The first line here should read:
#if (!string.IsNullOrEmpty(Model.Information))
Note the "!". That explains why you were seeing the markup previously, even though the parameter was not set. You need to update the code in the view in order to fix it.

newline in models.TextField() not rendered in template

I have a model with an attribute,
desc = models.TextField()
I entered data using admin interface provided by Django and then later viewed my template where the database values are fetched and displayed.
In my admin interface I left newline (just by leaving blank lines in between my paragraphs) but they are displayed as a single paragraph in my template.
I'm using Django 1.3 and MySQL.
linebreaks
Replaces line breaks in plain text with appropriate HTML; a single newline becomes an HTML line break (<br />) and a new line followed by a blank line becomes a paragraph break (</p>).
For example:
{{ value|linebreaks }}
Just a note, I was having a similar problem with newlines not showing up and I realized that when a TextField is declared as readonly, the text is wrapped with HTML paragraph tags:
<p> text </p>
as opposed to pre tags:
<pre> text </pre>
Pre tags preserve new line spaces, so if you do NOT make the field readonly, you will see the linespaces.
John, looks like you got a great answer from Ignacio. I just wanted to point out the steps that I took to use Ignacio's answer for those who may be confused (like I was). Inside my template where I display the text field I added the "|linebreaks" behind the template field name (in my case a "job.desc"):
<ul>
{% for job in varDataObject %}
<li>
<h4>
<a href="#" onclick='funPath("Job", {{ job.id }})'>{{ job.title }} </a>
</h4>
Description: {{ job.desc|linebreaks }}
Saving text with newline (not \n) in your model's TextField() using sql:
update event
set description='xyz
asdasd
oaisjd '
where id=1;
In Django template:
{{ object.description|linebreaks }}

can't add a link to an entire div section

I have a problem with TinyMCE in Joomla 2.5.4. I have tried for a few days now to add a link to a div section (like <div> something< </div> ) but failed, the anchor is stripped from the HTML section because TinyMCE sees that as being wrong in HTML4. After a 3 days research I gave up and instead of a div i used a unordered list.
Now when i try to add a link to a list item (like <li> <p> something </p> </li> ) TinyMCE rearranges everything and moves the anchor inside of the list item (like <li> <a href="#"> <p> something </p> &=lt;/a> </li>).
I have tried pretty much everything from valid_elements : "[]" to text filter: No Filtering but i ran low on ideas.
Can anyone please help me?
Try playing around with TinyMCE's html5 options: http://www.tinymce.com/tryit/html5_formats.php
Hit "view source" to see how they're doing it. It's mainly this option inside tinyMCE.init:
schema: "html5",