I got some code in XSLT in my sitecore project which displays link:
<sc:link title="{sc:fld('MenuTooltip',.)}">
<xsl:call-template name="DisplayTitle"/>
</sc:link>
This is working fine unless I got text with '?' on MenuTooltip Field in sitecore.
For example, if MenuTooltip got "Reference Centre" it's fine it generates below html
<a title="Reference Centre" href="/reference-centre">Reference Centre</a>
Perfect now the things get bad, If I got "Reference Centre?" in MenuToolTip it generates some thing like below
<a &haschildren="true" href="/reference-centre">Reference CentreReference Centre</a>
Any ideas on this?
There might be two issues either you have some custom code running on sc:Link. check the below configaration in web.config
in my case i have not had any custom code and i am using Sitecore.NET 6.6.0 (rev. 130529).
So
I replaced sc:link with anchor tag:
<a href="{sc:path(.)}" title="{sc:fld('MenuTooltip',.)}">
<xsl:call-template name="DisplayTitle"/>
</a>
Suggested by -John west
Related
I create a simple one page website with text using Big Rock's webcreator. I tried to link one of the lines one the page using HTML in the following way:
<a href="iimk.ac.in/faculty-profiles/ASHOK-THOMAS">iimk.ac.in/faculty-
profiles/ASHOK-THOMAS</a>
The hyperlink however is not working. I would like to fix the error in the HTML code.
Try this your link is not correct as it doesn't covers the proper URL of the page:
<a href="https://iimk.ac.in/faculty-profiles/ASHOK-THOMAS">iimk.ac.in/faculty-
profiles/ASHOK-THOMAS</a>
Visit this link to see the proper working of the hyperlink:
https://i.stack.imgur.com/KFSB9.png
your link is not correct with the https formatting so just use this
<a href="https://iimk.ac.in/faculty-profiles/ASHOK-THOMAS">iimk.ac.in/faculty-
profiles/ASHOK-THOMAS</a>
I have a snippet of html which I extracted from the source of a webpage I'm working on:
<span itemprop="homeLocation" itemscope itemtype="http://schema.org/Place"><meta itemprop="name" content="Kansas"/>
...and I'd like to extract the location, Kansas from it, using Xpath.
Using an Xpath checker, I have been testing this but to no avail.
I tried
//*[#itemprop="homeLocation"]/meta[#itemprop="name"]/#content
and similar attempts, but can't seem to get a match. I don't understand what I'm doing wrong.
Any advice would be greatly appreciated.
Your xPath is absolutely valid.
The problems are with xml.
Close span tag.
Set some value for itemscope attribute.
And the most important. xPath checker your are trying to use seems to have some bugs. Check this one: http://www.freeformatter.com/xpath-tester.html#ad-output
Xml I've used:
<span
itemprop="homeLocation"
itemscope=""
itemtype="http://schema.org/Place">
<meta itemprop="name" content="Kansas"/>
</span>
Result:
Attribute='content="Kansas"'
I am getting H2 violation for below anchor tags.
It says 'H2: Combining adjacent image and text links for the same resource'
<div class="selected-label ccyImage">
</div>
<a href="javascript:void(0);" class="btn dropdown-html-toggle" tabindex="-1">
<span class="caret"></span>
</a>
But there is no any image used. Not getting how to resolve it.
So you have some unspecified tool which is detecting an accessibility problem which is different to the accessibility problem you actually have (or it is being really smart and noticing that you are expressing content using background images … don't do that).
There's not much you can do about the misidentification of the problem other than to report a bug to whomever makes the tool.
You can make your HTML more accessible by:
Not using links when you aren't linking somewhere. If you're using href="javascript:void(0);" then you're doing something wrong.
Link to somewhere useful and progressively enhance or
Use a button (not a link) if you can't make it work without JS
Putting content in your links (or buttons). There is no text at all there to give any clue to the user what the interactive element is going to do.
so I have a strange request. I've been working on some security project for school, and I've been able to successfully inject some html code using a form on our test site. What's interesting is that it only accepts the html code as one line and with no spaces. This brings me to my question, so far I've only been able to get text and font color changes to work. But I want to see if someone could inject images/audio/video.
I'm trying to figure out how to turn this:
<img src="http://www.rtur.net/blog/image.axd?picture=2011%2F12%2Fcss.png"/>
Into this:
<imgsrc="http://www.rtur.net/blog/image.axd?picture=2011%2F12%2Fcss.png"/>
but add a space with code.
I've tried adding the but that only works with actualy text and not the tag itself. Any help is appreciated.
Interesting note: I was able to inject <font size="50" color="red"></font>
But I have no idea why that works but the image doesn't.
Have you tried the following?
A slash:
<img\ src="http://www.rtur.net/blog/image.axd?picture=2011%2F12%2Fcss.png"/>
Using a non-traditional closing tag:
<img src="http://www.rtur.net/blog/image.axd?picture=2011%2F12%2Fcss.png"></img>
Injecting a blank <img> tag:
<img src=""/>
Here's another solution: Try inline CSS:
<div style="background:url(http://www.rtur.net/blog/image.axd?picture=2011%2F12%2Fcss.png);height:400px;width:400px"></div>
See this fiddle: http://jsfiddle.net/9MYrM/
I'm new to the world of XSLT, I only know the basics. I am trying to modify some files to work on Chrome (at the moment they work only on IE). One if the issues I have now is in this section:
<td class="2k3ButtonContainer">
<div id="coolTheme" style="height:20px;direction:rtl;background:URL('../../Assets/UI/Images/{$name}.gif') no-repeat 100% 0px;padding-right:20px;" dir="rtl" class="2k3Button" onclick="{$onclick}">
<xsl:value-of select="$caption"/>
<xsl:if test="$hasDown='1'">
<img src="../../Assets/UI/Images/Splash/arrow.down.gif" align="absmiddle" style="width:7px;height:4px;margin:0 2 0 2"/>
</xsl:if>
</div>
</td>
The line <xsl:value-of select="$caption"/> that should replace the text of the div isn't working for Chrome. The variable exists, I know it because $name and $onclick are correct, but when placed in the div as text I cannot get the value of the caption variable. (I get the buttons with the correct images and events, but without labels).
I tried to read about it, but I am not sure what to look for, and I didn't understand the little info I found about it.
Thanks all in advance.
XSLT variable references are tricky. Try referencing it the long way instead:
<xsl:value-of select="document('')/*/xsl:variable/#select[../#name='caption']"/>