Had a question concerning replace text that is in the content of an element, but surrounded by other elements. ie:
<one>
<two>a</two>
three
<four>b</four>
</one>
In this example how would I select and change the text "three"? I am attempting to clone the li:nth-child(2), I have a second snippet that will grab the insides of such an li.
How do I change the word Shirts & Dashboard in the code below, as in what series of enlive selectors can do it while keeping the other elements intact?
<ul id="side-menu" class="nav">
<li>
<a href="index.html">
<i class="fa fa-dashboard fa-fw"></i>
Dashboard
</a>
</li>
<li>
<a href="#">
<i class="fa fa-bar-chart-o fa-fw"></i>
Shirts
<span class="fa arrow"></span>
</a>
<ul class="nav nav-second-level collapse">
<li>
<a href="/">Rush</a>
</li>
</ul>
</li>
</ul>
Here is the top level snippet to grab the side bar and dump it into the root template.
(html/defsnippet side-nav-links "public/index.html" [:#side-menu] []
[[:a (html/attr= :href "index.html")]] (html/do->
(html/content "Dashboard") ;; this overwrites the <i> tag so knowing how to change this text is ideal too.
(html/set-attr :href "/"))
[[:li (html/nth-child 2)]] (html/clone-for [x [1 2 3]]
(html/content (nav-sub-group))))
Here is where I grab the inside of the li to create new lis based on this structure.
(html/defsnippet nav-sub-group "public/index.html" [:#side-menu [:li (html/nth-child 2)]] []
[<<<Change text of "Shirts" here>>>] <<< ? >>>)
All of the HTML/CSS is open for change. I simply need to know the simplest solution, and advice on anything else I am doing wrong is great too.
Best,
Jarrod