In below div, I want to break the text of title property(want to display company id, name and activities in different lines). Can anyone suggest me the best way to solve this problem.
Thanks
DIV id="window6" class="component window" style="top:300px;left:250px;" title="CompanyID:25 Name:Company 25 Activities:,INVHLDGS, MallOwned:123 "
6000000
/DIV
If you'd like the tool tip displayed for the div title to have line breaks then how about using a jquery plugin like this one: http://twitter.github.com/bootstrap/javascript.html#popovers
You can add <br /> tags to the pop up content (data-content):
hover for popover
I see the JS Bootstrap online example uses an "a" tag, but it should also work with a "div" tag. NB: this plugin also requires that the Tooltip library be included. Read their documentation if you like this plugin. Of course their are many other similar plugins, especially with jQuery that may have this specific function.
Related
I'm using Commerce module for product catalog and for a single product i have fields like: image, title, price, weight,... and i would like to display image on the left side and text fields (title, price,...) right next to it. But the auto-generated code looks something like this:
<div class="container">
<div>
<img></img>
</div>
<div>Title</div>
<div>Price</div>
<div>Weigth</div>
<div>Size</div>
</div>
So ofcourse, I am able to style the div containing an image with css with
width: 50%;
But I cant do that with those divs containing text info, since they are by themselves and dont have a wrapper div. So my question is there a way to "manually" add that wrapper div? Or maybe another way to solve this?
Yes you can, using a custom templates (in your theme). You can also look at modules like Fences and Display suite to control markups for your node.
You can create your own 'Theme' elements. Instead of doing the changes in your, let's say, Bartik Theme, (Commerce is your module). Create a new folder with your own theme name inside
> sites
> all
> themes
> your-theme-folder
Copy the theme you have now and do your changes inside your css file accordingly.
Make your theme your default.
This should be very simple, i can not believe that a company the size of Wordpress cannot provide users a very simple way to make line breaks.
I know how to use the text tab and code the page using html (im a developer). However my clients have absolutely no idea what html is so they obviously can not use it.
All the client wants to do is make a "space between lines" , in our terms a break line. They only want to use the visual editor.
Now when they start typing and hit enter, it creates & nbsp; or closes a paragraph tag.
Many articles are saying that shift + enter will make one, however this 100% does not as ive tried.
Ive tried a plugin that most articles are suggesting called "tinymce advanced". But this does not resolve the problem.
Is there any way possible for a normal user with no html knowledge to only use the visual editor and create br lines without actually using code?
Holding down Shift+Enter definitely works.
Alternatively, you can always prevent Wordpress from automatically adding <p> tags to the markup using the following code inside of your theme's functions.php file:
remove_filter('the_content', 'wpautop');
I had this problem on my site, it began when I updated the theme, which had not been updated for years.
The "miraculous" solution was to update
all the plugins as well.
I have realized that the
<br / > and the < p >
symbols are not present in the wp editor in text mode
So there must be a conversion between \n (newline) and <br / > and < p > taking place, I have not investigated this further, but maybe somebody can explain how WordPress is working.
With the WordPress upgrade to version 3.2, the text editor seems to remove the line break by itself.
Add a filter in the functions.php file which adds a clear attribute to the <br/> tag. When the attribute is added, the <br/> tag is not removed by WordPress.
function clear_br($content){
return str_replace("<br/>","<br clear='none'/>", $content);
}
add_filter('the_content','clear_br');
Then apply this filter on a variable where you need break should come in that text content
$specification = apply_filters( 'the_content', $specification );
For more info: https://blog.templatetoaster.com/wordpress-line-break-not-working/
This small code fixed my issue.
echo nl2br(category_description( the_content);
Just replace the content tag with this in you file
I am making help content documentation for an already made software (the kind of which opens in every software when you press F1 or navigate to the Help section in the menu bar). I am using simple html/CSS/js pages to do so.
There is a ton of the same text descriptions of various software properties that appear in more than one page. The idea is to make a single text source file, where all the text descriptions are located and then use some sort of referencing to that specific text section wherever necessary.
Kind of a similar to using a CSS stylesheet to apply styles over all of the pages, only this handles text instead of styles. This way I would be able to change text in only one file and it would apply everywhere it is used.
I ran across the html SSI method, but this only includes the entire html page and not just a specific text section the way I would like to. I would strongly avoid using different file for each text section.
Can anyone please point me into the right direction here?
I think that you can make a JavaScript function that contains the common texts and use this functions in your code whenever you need them, for this the JavaScript that you create should be an external file and you can reference it in every html page you need it.
For example, you can have one function that returns "Hello World" and set this to a "p" element with the id="title". So in every page where you have an element with the id title you can call your JavaScript function to set its text to "Hello World". Use this link to find out more about this topic:
http://www.w3schools.com/js/js_htmldom_html.asp
UPDATE: I did a little test, i created the following JavaScript:
function helloTitle(){
var text = "Hello World!";
document.getElementById("title").innerHTML = text;
}
And referenced it in some HTML pages like this:
<script src="commonText.js" type="text/javascript"></script>
After that i only need to call the function in the element i want it to modify:
<p id="title"><script>helloTitle();</script></p>
This is a solution if you are only using JS, CSS and HTML. There should be other ways to achieve this.
Hope this information could help you!
I figured out how to do it a little more comforatbly on a large scale using the html command https://www.w3schools.com/tags/tag_iframe.asp
in your main html file you do:
<p> <iframe src="Text.html" width="100%" height="300" style="border:1px solid black;"> </p>
and then with some basic html formating insert whatever text u want
<html>
<body>
hmm idk what i should put here. Test
</body>
</html>
there will also be some css formatting needing to be done before it look perfect, but if you want to make multi line blocks I think this is the easiest way to.
I had previously managed to get Zencoding in ST2 to autocomment closing tags eg:
I'd type div.my_div and hit tab and as well as creating the div, it would also add a closing comment so that I can easily navigate the closing div tags in my document.
<div class="my_div">
*
</div> <!-- .my_div -->
Do any of you know how to replicate this?
Thank you.
You should use “comment“ filter: http://code.google.com/p/zen-coding/wiki/Filters
.my_tag|c
You can also make ZC to automatically apply “comments” filter to HTML. It‘s a bit hacky, but you need to open zen_settings.py file and add c filter at https://github.com/sublimator/ZenCoding/blob/master/zencoding/zen_settings.py#L511
It should look like this:
"filters": "html,c"
Just wondering whether anyone knows how to get blogger labels into "alt" tags in an image. I have tried alt="data:post.labels" to no available at all?
Doesn't anyone know how to assist with this on blogger?
P.S - I know about the ‘rel=tag’ - but for the specific template, I want to have the labels appear as text in the alt tags?
Looks like you may be using the XML version of templating Blogger. If that's the case, then you'll need to use something like the below if you want to have the ALT attribute show up with the name of the tag:
expr:alt='data:label.name'
You can use the same principle to display the label/tag in the TITLE attribute of a link, link so:
<a expr:href='data:label.url' expr:title='data:label.name'><data:label.name/></a>