Search
Other ReReplacer questions
Forum

replace html to multiple lines

marvays's Avatar marvays
Hello.
I want to replace a piece of html code of the page, but I can't. This is the code from the page module. I've been trying for two hours now and haven't figured out a way to do it.
Here is the original html code:
<ul  class="navigace">
<li class="active">
<span class="divider icon-location"></span>
</li>
<li  >
<a  href="/" class="pathway"><span >www.lukysipy.cz</span></a>
<i class="fa fa-angle-right"></i>
<meta  content="1">
</li>
<li   class="active">
<span >
					Filtr				</span>
<meta  content="2">
</li>
</ul>

But if I specify to search only this:
Filtr				</span>
... no problem.

If I add one line it won't find it anymore. Won't there be a problem with spaces?
<span >
					Filtr				</span>

The change will be for one page of the site with the exact url. I still have a copy for h1 heading from "Filtrace" for better SEO page title. This one works great because it's on one line.

Sample:
www.lukysipy.cz/kuse/se-zasobnikem

You may argue that changing one word is enough. But I want to replace this navigation with a more detailed one and add an extra item. And if I solve this problem, I can use it elsewhere.
Peter van Westen's Avatar Peter van Westen ADMIN
Can you explain what in that HTML you want to replace with what?
Please post a rating at the Joomla! Extensions Directory
marvays's Avatar marvays
Original
<h1 class="navigace-title">Filtering</h1>
<ul  class="navigace">
<li class="active">
<span class="divider icon-location"></span>
</li>
<li  >
<a  href="/" class="pathway"><span >www.lukysipy.cz</span></a>
<i class="fa fa-angle-right"></i>
<meta  content="1">
</li>
<li   class="active">
<span >
					Filter				</span>
<meta  content="2">
</li>
</ul>

Replace with this modified code
<h1 class="navigace-title">Kuše se zásobníkem</h1>
<ul  class="navigace">
<li class="active">
<span class="divider icon-location"></span>
</li>
<li  >
<a  href="/" class="pathway"><span >www.lukysipy.cz</span></a>
<i class="fa fa-angle-right"></i>
<meta  content="1">
</li>
<li  >
<a  href="/kuse" class="pathway"><span >Kuše</span></a>
<i class="fa fa-angle-right"></i>
<meta  content="2">
</li>
<li  >
<a  href="/kuse/pistolove" class="pathway"><span >Pistolové kuše</span></a>
<i class="fa fa-angle-right"></i>
<meta  content="2">
</li>
<li   class="active">
<span >
					Kuše se zásobníkem				</span>
<meta  content="3">
</li>
</ul>
Peter van Westen's Avatar Peter van Westen ADMIN
Try this with Regular Expressions on:
<h1 class="navigace-title">.*?</ul>
Please post a rating at the Joomla! Extensions Directory
marvays's Avatar marvays
Nice. It´s work!

.*? = everything between <h1 class="navigace-title"> and nearest </ul> ?
Peter van Westen's Avatar Peter van Westen ADMIN
Yes...
If you want to learn more on Regular Expressions, see: www.regular-expressions.info/tutorial.html
And there are many good videos on youtube on Regular Expressions.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription