Link to an href
Posted: Fri Jan 13, 2017 7:55 pm
Is there a way to generate an id, and populate the href through an action? And if so, is there a way to differentiate cases where you have multiple section with the same class as with "topic" in the example below?
My tagging fragment looks like this:
When I run this, the id generates, but the xpath doesn't populate the href, below is what the action places:
I'm using the xhtml framework. Any thoughts? Please let me know if you need more information to answer this question.
Thanks,
Tom
My tagging fragment looks like this:
Code: Select all
<section class="topic" id="${id}" xmlns="http://www.w3.org/1999/xhtml">
<header>
<h1 class="title"><a href="#${xpath_eval(//section[@class='topic']/div[@class='toggleable']/@id)}" class="toggle">Searching for answers</a></h1>
</header>
<div class="toggleable" id="${id}">
<p><a href="#${xpath_eval(//section[@class='topic']/div[@class='toggleable']/@id)}" class="toggle-close">close</a></p>
</div>
</section>
Code: Select all
<section class="topic" id="ops_ddd_py">
<header>
<h1 class="title"><a href="#" class="toggle">Searching for answers</a></h1>
</header>
<div class="toggleable" id="pps_ddd_py">
<p><a href="#" class="toggle-close">close</a></p>
</div>
</section>
Thanks,
Tom