Xpath with specific child and parent Classes - dom

Suppose the following HTML
< div class="entry" >
< div class="partial_entry" >
Hello
< /div>
< /div>
I want to select Hello using Xpath...Select all elements with class partial_entry where parent is of class entry..

Try this:
//div[#class='entry']/div[#class='partial_entry']/text()

In Chrome Dev Tools or Firebug, in their DOM views("HTML" bookmark in Firebug and "Elements" bookmark in Chrome Dev Tools) you can quickly get an element xpath by righ-clicking it and selecting "copy XPath".

Related

Remove RTE Title Text in TYPO3 6.1

RTE still clutters any link with title="Opens external link in new window" and worse, title="Opens internal link in current window".
I've tried removing it with
RTE.classesAnchor.externalLinkInNewWindow.titleText >
RTE.classesAnchor.internalLinkInCurrentWindow.titleText >
in page TSconfig, but no luck. Actually, I'm not even sure if this has to go into TSConfig or TS.
How can I disable this legacy feature?
PS I do still use
config.extTarget = _blank
but if it's really necessary, I can turn it off
To get rid of these texts, right of the beginning of a project (before content is filled in) use this PageTS-Config:
## get rid of "Opens link in ..."
RTE.classesAnchor.externalLink.titleText >
RTE.classesAnchor.externalLinkInNewWindow.titleText >
RTE.classesAnchor.internalLink.titleText >
RTE.classesAnchor.internalLinkInNewWindow.titleText >
RTE.classesAnchor.download.titleText >
RTE.classesAnchor.mail.titleText >
To look for the right names, go into the Module "Info", select a page from the page tree, click "Page TS Config" on the Dropdown-Select on the Top, and then "RTE." on the following Dropdown-Select.
This will remove all title attributes from links when saving:
RTE.default.proc.entryHTMLparser_db.tags.a.fixAttrib.title.unset = 1

How do I remove <p> </p> tags in typo3 RTE text content elements?

Hello I'm getting crazy around a dummy problem: how to remove paragraph tags < p > that RTE (in Typo3 6.1.7) adds oafter saving some text contents. I wish to add some images here to better explain this funny thing but I can't since I've not (yet) enough reputation.
BTW I put the images on an external site:
http://s16.postimg.org/uqbu40fut/rte_ptags_1.jpg
http://s16.postimg.org/7q56roi11/rte_ptags_3.jpg
The first image is a text entered in RTE; the second image (not shown here for the same reputation matter) is the same text shown in the "<>" raw view; the last image is what I see in raw view AFTER saving the content element.
I think that I must do something in the template or in the Typoscritp settings to remove these < p > useless tags... But what ??
Those <p> tags are enabled by default because in most cases you want your Text wrapped in propper HTML markup. However, typing your question into google, gets me to this two lines of Typoscript, wich I just tested on a 6.1.7 and which seem to do the job:
tt_content.stdWrap.dataWrap >
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines >
// Remove Class Of <p class="bodytext">
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.addAttributes.P.class =
// Remove P tag
tt_content.stdWrap.innerWrap >
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines >
//Remove Extra Figure Tag of Image
tt_content.image.20.renderMethod = figure
tt_content.image.20.rendering.figure

CSS multi-column layout of forms in Firefox

It looks like FireFox (my version is 19.0.2 - OSX) doesn't render forms properly using multicolumn layout. It renders normal paragraph text etc properly, but not forms.
The CSS:
fieldset {
-moz-column-count: 2;
column-count: 2;
-webkit-column-count: 2;
}
This is what it looks like in FireFox:
This is what it looks like in WebKit browsers:
Please view this sample code / live demo in FireFox to see that it doesn't render the multi-column layout for form elements.
Is this a bug, or is there something I can do to get it working in FireFox too?
Maybe the multi column attribute can't apply for the moment on this specific markup element that you use (namely fieldset).
Fieldset is dedicated to group some form fields, but I'm not sure it is already implemented to render in multi column...
So I should think that it is a bug that will be corrected in the future...
You can counter this by creating a simple div with flot left for the first form elements... Of course, with this option, you have to manually split the form elements that will be drawned on the left and on the right, you don't have the magic of equals length mutli-colmun anymore...
div#column1{
width : 400px;
float : left;
}
div#column2 {
float : left;
}
<div id="#column1">Your first fields</div>
<div id="#column2">Your second fields</div>

How to traverse DOM in ExtJS using CSS3/XPath?

Here's my sample HTML:
I would like to modify the content of the highlighted div to "New Title".
Here's my current code:
var divTitle = Ext.select('div[id="main_form"]/table/tbody/tr[1]/td/table/tbody/tr[1]/td/div/div[2]/div');
It seems that it is not working. I got that from using Chrome browser and copying the XPath. Can someone help or guide me here?
Also, I believe you can also simplify the query using the CSS select (in my case 'pt_title') so please mention how that can be coded too.
Thanks in advance.
Found one solution (using CSS selector):
var divTitle = Ext.select('#main_form div.pt_title');
I'm still interested on the other solution wherein you really have to go down each element. I believe this is the equivalent in jQuery:
var divTitle = $('#main_form > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(1) > td > div > div:nth-child(2) > div');
divTitle.update('New Title');

jquery - further querying "this"

i want to further use css selectors on "this" how can i do it? specifically i am trying to select this's sibiling ul > li > a's
how can i do it?
this + ul > li > a
i find that using sibling i cannot do .sibling("ul > li > a"), but i can use 3 .siblings() to do it? maybe i am using the wrong function? maybe i shld use find()? but the 1st "operator" i want is to get the sibling ul (i think i can also use next("ul")?)
$('ul>li>a', this) if I understood correctly.
Or
$(this).siblings('ul').find('>li>a')