Fork me on GitHub

HTML tags in $output->Text()  Bottom

  • Hello all...another dumb question, but I can't seem to get the search function to give me results I need, so sorry if this has been asked before.

    I am trying to output simple HTML center tags...I don't know if I can embed them in here or if it will make the output all screwy. Instead of outputting the tag, it is outputting the literal string with the angle brackets and all. Anyone know what is wrong? (I tried two different ways).

    Code:

    $output->Text('<center>');
    $output->Text("<center>" . _FMM_MESSAGE . "</center>");


    Thanks[/b]</center>
  • You need to set the input mode to "verbatim" before the tags...and then back to "parse" after you're done. So in practice:

    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text('<center>');
    $output->Text('any other HTML stuff...');
    $output->SetInputMode(_PNH_PARSEINPUT);

    ...also note that the tag you have in your sample above is incorrect. It should be:
    ...</center>
  • Thank you very much...sorry for the newbie question.
  • The center tag is deprecated, better use CSS icon_smile And pnHTML is declared legacy, for new modules you are encouraged to use pnRender for templating.

    --
    "He is not dangerous, he just wants to play...."
  • Until someone starts producing some docs on writing templated modules (other than code comments) it's going to be fairly attractive. Now that pnHTML is phasing out, I'm seeing mod-writing docs for it...I certainly hope that's not the case for pnRender.

    BTW...loving pnForum!
  • landseer,
    what's cmods?
    BTW I wish you had english on your site
  • Try here Bri... English support site for pnForum...
  • hey thanks!

This list is based on users active over the last 60 minutes.