5
<h3><?php echo $this->__('Details & Documents') ?></h3>

The above prints out as: Details &amp; Documents

What is the proper syntax so that it prints as: Details & Documents?

Thanks

vulgarbulgar
  • 845
  • 1
  • 13
  • 28
  • This prints fine for me... are you changing `&` in the method `$this->__();`? – Will Dec 22 '11 at 17:53
  • 1
    Based on the `

    `-tag, `Details & Documents` *is* the correct output from the function. You're not allowed to have stray ampersands in HTML (or XML, for that matter); that's why `&` is used instead.

    – Michael Madsen Dec 22 '11 at 17:54
  • 1
    `Details & Documents` is _correct_. – SLaks Dec 22 '11 at 18:10
  • @MichaelMadsen & prints as & unfortunately. – vulgarbulgar Dec 22 '11 at 18:29
  • @SLaks Unfortunately

    __('Details & Documents') ?>

    prints as Details & Documents, and not Details & Documents.
    – vulgarbulgar Dec 22 '11 at 18:30
  • 1
    @vulgarbulgar: `Details & Documents` is invalid HTML. – SLaks Dec 22 '11 at 18:31
  • @vulgarbulgar: Then my guess is that you either: a) have something else re-encoding the HTML, b) actually have `Details & Documents` as the input, or c) you're not viewing it as HTML/XML. In any case, it seems like there's something missing here. – Michael Madsen Dec 22 '11 at 20:12

1 Answers1

5

html_entity_decode should do what you want:

<h3><?php echo html_entity_decode($this->__('Details & Documents')) ?></h3>

Although there may be a Magento-specific setting for this.

Bojangles
  • 99,427
  • 50
  • 170
  • 208
  • 1
    Same, pritns as Details & Documents – vulgarbulgar Dec 22 '11 at 18:28
  • I noticed that before Tim Cooper had edited your post, there was a space after `&`, so it looked like this: `& amp;`. Was that a typo, or does your output _actually_ look like that? – Bojangles Dec 23 '11 at 00:20
  • That was on purpose, because, for whatever reason, whenever I entered without the space, the post here on this website would print as an '&', instead of & – vulgarbulgar Dec 23 '11 at 17:43