This might be a difficult one… I have a Drupal site, and I need to find a way to copy a title string from a specific point within a Node’s main DIV and add the title as plain text right after an author’s link. Here is the following example Node setup:
<div id="node-19435" class="node"><div class="meta">
<div class="submitted">
<span class="authors">
<a href="/authors/john_doe">John Doe</a> Copied Title Here surrounded by new span
</span>
</div>
<div class="terms">
<ul class="links inline">
<li><a href="/headlines" title="he">Headlines</a></li>
<li><a href="/authors/john_doe" title="Original Title Is Here">John Doe</a></li>
</ul>
</div>
</div></div>
The list items may be in any order, so the only components that could be used are the author’s actual name string, or the path of the link to the author’s page.
Keep in mind that the node is sometimes repeated in multiple div.node divs on a single page, and will have to do the same inside each div.node it finds. Thank you for your help. I’ve been busting my mind for days over this, and seeing all your expert answers has inspired me more often that I can say.
Please help me find a nice JQuery solution for doing this.
If I’ve understood your problem correctly, I think you’re trying to do something like this, correct?
I’ve assumed that the only way to match links within a div.meta block is by the URL of the link starting with “/authors”.