Change a Rendered HTML Attribute with QC Dynamic Replacer

Change an HTML attribute is a current Rule action for changing an attribute fragment that already exists in rendered frontend HTML. In QCDR 1.1.05 it uses the normal rendered-output matcher; there is no separate attribute-name/value form.

What the Action Actually Changes

QCDR does not edit a template, module file, or stored article field. The System plugin receives the rendered frontend response and the Rule replaces the matched attribute fragment in that response. Because the action uses the same matcher as the other Rule actions, make the Find value specific enough that it identifies the intended attribute rather than unrelated text.

Create a Safe Attribute Rule

  1. Open Rules and create or edit a Rule. Keep it Draft while testing.
  2. In Find this, enter the rendered attribute fragment you want to change, for example class="old-badge".
  3. Choose Change an HTML attribute.
  4. Choose Enter a value and enter the replacement fragment, for example class="new-badge".
  5. Use page/menu, component/module, audience, and occurrence controls to narrow where the change is allowed to run.
  6. Save and inspect the actual frontend HTML before enabling the Rule broadly.

Match the Rendered Markup, Not the Source File

The Find value must match what Joomla actually sends to the browser. A template override, plugin, module, minifier, or other runtime code can produce markup that differs from the PHP or editor source you started with. Inspect the final frontend output when a Rule does not match.

Avoid Broad Attribute Fragments

A short value such as active can appear in ordinary text, classes, data attributes, JavaScript, or other markup. Prefer the complete attribute fragment or another distinctive rendered sequence, then use Exact phrase / whole term, case matching, occurrence limits, and narrow targeting as appropriate.

Validate the Result

After the Rule runs, inspect both the visible page and the rendered HTML. Confirm that the replacement did not create duplicate attributes, broken quoting, invalid markup, or an unintended match elsewhere on the page.


Community Discussion

Want to compare workflows, share practical tips, or discuss how you use this QCDR feature? Visit the QC Dynamic Replacer Community. For private support, bug reports, account-specific issues, or feature requests, use the QuantaCade support system.