Development

#3199 ([PATCH] sfSimpleCMSPlugin : sfSimpleCMSSlotText generates invalid XHTML)

You must first sign up to be able to contribute.

Ticket #3199 (new defect)

Opened 8 months ago

Last modified 1 month ago

[PATCH] sfSimpleCMSPlugin : sfSimpleCMSSlotText generates invalid XHTML

Reported by: onanga Assigned to: Kris.Wallsmith
Priority: minor Milestone:
Component: sfSimpleCMSPlugin Version: 1.0.12
Keywords: p tag, xhtml validator, simple text slot Cc:
Qualification: Unreviewed

Description

if you set a content such as this in your template :

<h1 id="title">
  <?php sf_simple_cms_slot($page, 'title', 'Title') ?>
</h1>

And your slot, should be as simple as possible : basic text. Then you would obviously pick Simple Text as slot type.

The issue here is that is uses simple_format_text() which always returns your text wrapped in a <p></p> tag.

A clean solution is to implement a new slot type such as sfSimpleCMSSlotBasicText which would return text as such (tag stripped), and would be editable in an input text tag.

See the file attached and add it to modules/sfSimpleCMS/slotType/ And add in apps/<my_app>/config/app.yml

  sfSimpleCMS:
    ...
    slot_types:                                 # Available slot types
      BasicText:      Basic text
    ...

Attachments

sfSimpleCMSSlotBasicText.class.php.tar.gz (0.7 kB) - added by onanga on 03/25/08 12:48:22.
New simpleCMS slot proposal : sfSimpleCMSSlotBasicText

Change History

03/25/08 12:48:22 changed by onanga

  • attachment sfSimpleCMSSlotBasicText.class.php.tar.gz added.

New simpleCMS slot proposal : sfSimpleCMSSlotBasicText

10/31/08 19:35:54 changed by Kris.Wallsmith

  • owner changed from francois to Kris.Wallsmith.