Get the current Node in JSP with Jahia? - jahia

Is there a way to get the current node you are with Jahia ?
I tried to find in the documentation, but Jahia's not greatly documented.
tried to use ${node.path} but didn't gave me what I wanted.

${renderContext.mainResource.node.path} is the solution.

Use ${currentNode} to get the current node you are.
<%--#elvariable id="currentNode" type="org.jahia.services.content.JCRNodeWrapper"--%>
${currentNode}
https://academy.jahia.com/documentation

Related

Facebook Analytics 'Current URL' doesn't work...?

It seems that filtering data, eg. creating a segment, or defining a funnel step, cannot use the 'Current URL' field. Or at least, it doesn't seem to work for me at all.
Am I missing something? Is this just broken?
Kind Regards,
Michael
Here are some docs that might help you. You can also play around with the Demo Event Source Group and create a segment like so:
Try leaving out the https://www.
That sometimes seems to help.

Can't query a node with xpath query

I am having some difficulty querying a node in an xml document. the document is http://ods.od.nih.gov/api/index.aspx?resourcename=BotanicalBackground&readinglevel=Health%20Professional
i am trying to get the text of the first node.
i have tried these queries and none of them seemed to work.
*[name()='ImageURL']
//captionedimage[1]
//Factsheet/RelatedImages/captionedimage[1]/ImageURL/text()
//RelatedImages/*[1]
greatly appreciate any help.
Your three last XPATH seem to be working (you can quickly check it out at http://www.xpathtester.com/test or http://www.freeformatter.com/xpath-tester.html). The problem should be linked to the environment you use.
When I tried them on scrapy the uppercases XPATH retrieved nothing, only //factsheet/relatedimages/captionedimage[1]/imageurl/text() seemed to be working. Sadly, this behavior is surprising to me and I have no idea why it acted that way. But you should definitely try and gather more info on the environment you're using.
Try this...
./Factsheet/RelatedImages/[local-name() = 'captionedimage' and position()=1]/[local-name() = 'ImageURL']

Script not working only in Firefox

I have a script that basically is a search/filter that runs all browsers except firefox. And I dont know what is wrong. I'm trying since saturday find what is wrong, searching here if someone had the same problem and nothing. I'm LEARNING javascript, so I'm hoping someone can point me into the right direction to find what i'm not doing right or what i'm missing. Any help will be appreciated.
http://jsfiddle.net/ccarizzo/GYcbE/
online here
The problem, as you can tell by looking in the error console, is this code:
$(listaProdutos).find('a:Contains(' + filter + ')').parent();
There is no "listaProdutos" variable in the script. You're relying on a non-standard behavior in other browsers that reflects all IDs into the global scope.
This should work:
$("listaProdutos").find('a:Contains(' + filter + ')').parent();
You need a similar change in some other places too.
Use the W3C validator to check interoperability of your web-scripts.
Click here to get yours validated.

What am I doing wrong with this Xpath Query?

I've been having a play with some Xpath queries but I just can't get this one.
Here's the current string: "/html/body/div/div[8]/table/tr/td[2]/a"
It's showing the information below, but I need to grab "Australia" or node 5. I've tried last() and selecting a node on the a but no luck.
Anyone able to help?
The following seem to work
/html/body/div/div[8]/table/tr[3]/td[2]/a
You seemed to be on the wrong row. But will the structure always be this static? Maybe you should try to look for something "better" in the page, such as the href containing "country" so be somewhat more resilient to structure changes.

Where is boost::lambda::ll?

I can't seem to find boost::lambda::ll for a nested ll::for_each() invocations in any header file in the boost_1_39_0 distribution. Could someone point me to the right direction? Thanks.
boost_1_39_0/boost/lambda/algorithm.hpp
first structure defined there is boost::lambda::ll::for_each

Resources