I want to implement some tooltip for breadcrumbs is there a way to do it.
Got the soloution through simple jQuery command added it in the itemoptions of the breadcrumbs array.
'rel'=>'tooltip','title'=>'click here to read the mail')), $this->menu=array(
array('label'=>'Inbox', 'url'=>array('MessageTo/inbox'),'itemOptions'=>array('class'=>'inbox', 'rel'=>'tooltip','title'=>'click here to read the mail')),
);
?>
Related
I'm trying to insert text into a textarea with a wysiwyg editor (summernote) from a form, i'm using behat featurecontext file for this. The textarea doesn't have a id tag so i need to select the class using javascript code:
document.getElementsByClassName('note-editing-area').item(0).innerText="something"
But when i do this, also the innerhtml is overwritten with the text from innerText.
Any suggestions?
Best way is to set an id or class and select that. If you do not use that it is way more difficult to maintain. You could add this through twig:
{{ form_widget(form.task, {'attr': {'class': 'task_field'}}) }}
I am new to python and scrape as well. Nevertheless, I spend a few days trying to scrape news articles from its archive - SUCCESSFULLY.
PROBLEM is that when I scrape CONTENT of the article <p> that content is filled with additional tags like - strong, a etc. And as such scrapy won't pull it out and I am left with news article containing 2/3 of the text. Will try HTML below:
<p> According to <a> Japan's newspapers </a> it happened ... </p>
Now I tried googling around and looking into the forum here. There were some suggestion but from what I tried, it did not work or broke my spider:
I have read about normalized-space and remove tags but it didn't work. Thank you for any insights in advance.
Please provide your selector for more detailed help.
Given what you're describing, I'd guess you're selecting p/text() (xml) or p::text (css), which is not going to get the text in the children of <p> elements.
You should try selecting response.xpath('//p/descendant-or-self::*/text()') to get the text in the <p> and all it's children.
You could also just select the <p>, not its text, and you'll get its children as well. From there you can start cleaning up the tags. There are answered questions regarding how to do that.
You could use string.replace(,)
new_string = old_string.replace("<a>", "")
You could integrate this into a loop which iterates over a list that contains all of the substrings that you want to discard.
I am trying to automate test case using Protractor and Jasmine. The problem is I have an "article" web element tag that gets created at runtime and this web-element has a as sub element. This div element has a "id" tag associated with it. The structure of the code is below.
<article class="a b c d" data-ng-repeat="xyz repeat">
<div id="THIS IS WHAT I WANT" class="class name">
</article>
Now I am able to get get hold of the article web-element. but I am not able to get the ID attribute in the div. The ID values is generated dynamically. Kindly suggest how I can get the ID value.
Thank you
You can use a CSS Selector like this:
article > div
This will get you a div inside of an article. Now you can use this to play around and specify the selector further with classes or other stuff.
If you managed to get the div element you can then pull out the idea using (not sure if the syntax is correct but you should get the idea):
element.getAttribute('id')
1) element(by.xpath(//div[#class='class name'])).getAttribute('id')
2) element(by.xpath(//article [#class='abcd']//div[#id='THIS IS WHAT I WANT'])).getAttribute('id')
You can use chains like this:
element(by.classname('')).element(by.className('classname'));
or
element(by.css('css of parent')).element(by.css('child css'));
or you can use element(by.repeater('repeat in reapeats')).element(by.css(''));
how to disable automatic adding of <p></p> tags in Fckeditor.
When i try to get any post data from fckeditor, it gives me the data wrapped in
how do i remove/disable those <p></p>
Thanks in advance for any suggestions and reply
Too late, but will help others reaching this page via search engines, like I found it.
<?php
include_once('fckeditor/fckeditor.php');
$oFCKeditor = new FCKeditor('description');
$oFCKeditor->BasePath = '/fckeditor/';
$oFCKeditor->Value = 'some text';
$oFCKeditor->Config['EnterMode'] = 'br'; // turn off auto <p> tags wrapping content
$oFCKeditor->Create();
?>
Refer http://www.tequilafish.com/2008/09/12/fckeditor-remove-p-tags-from-wrapping-your-content/
Adding to the previous answer, If you're using ColdFusion rich text area (which used fckeditor), you can disable the <p> tags by setting EnterMode to br in fckconfig.js
How do you display data in a 'textarea' using struts application,
This is my code:
<html:textarea property="comments" </html:textarea>
<bean:write name="FormBean" property="comments"/>
where FormBean is my beanclass and comment is a property in beanclass.
But I cannot get it too work.
Thanks in advance for your help.
If you use Struts action forms and you have the html:textarea tag inside your html:form tag (this tag is only valid when nested inside a form tag body) then the following code is all you need:
<html:textarea property="comments" />
Don't know what you are trying to do with bean:write but if you want to display that inside your html:textarea I'm not sure you can. The property attribute is mandatory for the html:textarea tag and will use that as the content.