Error in template
  • Hi using template 2

    the intro and full_text are both specified in the style sheet by
    <p class="tekst">

    But when you view the article the intro is fine but the full text has an extra <p> therefore removing the class - see below

    <p class="tekst">an intro</p>
    <p class="tekst"><p>thisisthe full_text</p>


    is there a workaround or change for this

    cheers
  • 1 Comment sorted by
  • Hi Mark,

    The WYSIWYG editor adds paragraphs correctly, so let's say you have an
    article with full text like this:

    "Lorem ipsum dolor sit amet.

    Etiam elementum pretium justo vel sollicitudin. Curabitur porta lectus
    a metus sagittis pharetra. Aliquam mi enim, fermentum a dapibus
    dapibus, placerat et neque. Mauris rutrum ante et tortor fermentum
    posuere."

    In HTML it means two paragraphs (<p> elements). Knowing this, it is
    wrong if you define something like this in your template file:

    <p class="text">{{ $campsite->article->full_text }}</p>

    As it is the case in templates demo 2. HTML says a paragraph element
    cannot contain block-level elements (including <p> itself).

    A solution could be to define your template like this instead:

    <div class="text">{{ $campsite->article->full_text }}</div>

    and then modify the corresponding style definitions.

    Keep in mind this same issue applies for all multi-line text fields
    (including intro).

    Hope this helps.



    On Wed, May 12, 2010 at 4:42 AM, mark casson
    <campsite-support@lists.sourcefabric.org> wrote:
    >
    > Hi using template 2
    >
    > the intro and full_text are both specified in the style sheet by
    > <p class="tekst">
    >
    > But when you view the article the intro is fine but the full text has an extra <p> therefore removing the class - see below
    >
    > <p class="tekst">an intro</p>
    > <p class="tekst"><p>thisisthe full_text</p>
    >
    >
    > is there a workaround or change for this
    >
    > cheers
    >


    --
    Holman Romero
    Sourcefabric

    holman.romero@sourcefabric.org

    http://www.sourcefabric.org