DB Replacer to change the first paragraph in...

Search
Other Pre-Sale questions
Forum

DB Replacer to change the first paragraph in content full text?

Buldre -'s Avatar Buldre -
Hi,

Is it possible to use DB Replacer to change the coding for the first, and only the first, paragraph in articles (content fulltext)?

For intro text in content full text, normally corresponding to the first paragraph, I will replace bold text with a special styling for the intro text. Is this possible to do with DB Replacer?

At least I need to replace the very first:
<p>

With something like:
<p class="ingress">

Or better, replace:
<p><strong>My intro text in content full text (...).</strong></p>

With this:
<p class="ingress">My intro text in content full text (...).</p>

If the above is impossible, maybe we can perform the change by including the "read more" code? Replace this:
<hr id="system-readmore" />
<p><strong>

With this?
<hr id="system-readmore" />
<p class="ingress">

Thanks!
Peter van Westen's Avatar Peter van Westen ADMIN
The database saves the introtext and fulltext separately.
So there is no '<hr id="system-readmore" />' in there.

Yes, with the pro version you can use Regular Expressions to target the first <p> tag in the fulltext.
Please post a rating at the Joomla! Extensions Directory
Buldre -'s Avatar Buldre -
Great! With that functionality, DB Replacer might be worth the money for me if I get the coding right. But then I read about Regular Expressions and realize that as a newbie I'm stuck. This is like learning a new language, and I can't spend a long time on this to find what is probably a very short and simple code.

So before I buy the PRO version, could you please exemplify how I can replace only the first occurrence of a sentence or code phrase, as mentioned in my first inquiry?

Thanks!
Peter van Westen's Avatar Peter van Westen ADMIN
Search (Regular Expressions):
^\s*<p>\s*<strong>(.*?)</strong>
Replace:
<p class="ingress">\1
Please post a rating at the Joomla! Extensions Directory
Buldre -'s Avatar Buldre -
Thank you for your helpfulness, which I appreciated!
You can only post on this forum if you log in