Forum

Thread tagged as: Problem

Issue width grid in Perch

I am trying to make a food-menu. But I have some issues in Perch with CSS grid. Some parts are thrown in wrong cells and some are thrown anywhere. In the static version all works correct. In addition at one part there is added an paragraph inside an other paragraph. Has anyone an idea to solve this obscure problem?

Summary information

    Perch: 3.1.2, PHP: 7.1.11, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO
    Server OS: WINNT, apache2handler
    Installed apps: content (3.1.2), assets (3.1.2), categories (3.1.2)
    App runtimes: <?php $apps_list = [ ];
    PERCH_LOGINPATH: /faly/perch
    PERCH_PATH: C:\xampp\htdocs\faly\perch
    PERCH_CORE: C:\xampp\htdocs\faly\perch\core
    PERCH_RESFILEPATH: C:\xampp\htdocs\faly\perch\resources
    Image manipulation: GD
    PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M
    F1: 3b606135b33e6a102526838f4152a807
    Resource folder writeable: Yes
    HTTP_HOST: localhost
    DOCUMENT_ROOT: C:/xampp/htdocs
    REQUEST_URI: /faly/perch/core/settings/diagnostics/
    SCRIPT_NAME: /faly/perch/core/settings/diagnostics/index.php

template:

<div class="menu-part">
<img src="<perch:content id="img" type="image" label="Bild" width="150" height="150" crop="true">" alt="<perch:content id="alt" type="smarttext" label="Bildbeschreibung" help="Beschreibung für Blinde bzw. falls das Bild nicht angezeigt wird" required>" />
<p class="artikelname"><perch:content id="artikelname" type="smarttext" label="Artikelname" required title help="Produktname"></p>
<p class="beschreibung"><perch:content id="beschreib" type="textarea" label="Beschreibung" markdown editor="simplemde" required></p>
<p class="preis"><perch:content id="preis" type="smarttext" label="Preis"  required></p>
</div>

screenshot : isuue with grid screenshot

part of the page.php:

<main>
        <h1 class="page-title">Eiskarte</h1>
        <div class="main-container">
            <div class="eis-text">
                <?php perch_content('Eis Text'); ?>

            </div>
            <div class="buttonset">
                <a href="" class="button-cafe" id="speisekarte">Speisekarte</a>
                <a href="" class="button-cafe nichtklickbar" id="eiskarte">Eiskarte</a>
            </div>
        </div> <!--* /main-container *-->

            <?php perch_content('Menu-card-header'); ?>
            <section class="menu">
                <?php perch_content('Menu-card-block Eins'); ?>
            </section>
<!-- The following isnot used in the moment -->
                <?php perch_content('Menu-card-header Zwei') ?>
            <section class="menu">
                <?php perch_content('Menu-card-block Zwei'); ?>
            </section>
Christoph Freyer

Christoph Freyer 0 points

  • 2 years ago
Simon Clay

Simon Clay 127 points

Hi Christoph,

I think it is because using Perch textarea automatically adds it's own <p> tags. It might be better to wrap that area with a <div> instead...

<div class="beschreibung"><perch:content id="beschreib" type="textarea" label="Beschreibung" markdown editor="simplemde" required></div>

Thanks, I changed it like you told me. Now the issue with the nested paragraph is solved, but the grid-issue is still here. I hoped this was the reason. Has anybody an idea for solving this. The example is working in Codepen and also in the static file. Only if I use perch it breaks the grid. the Codepen of the Grid

Simon Clay

Simon Clay 127 points

Can you see closely the difference between the working code and the Perch generated code? Perhaps its to do with whitespace?

Drew McLellan

Drew McLellan 2638 points
Perch Support

The example is working in Codepen and also in the static file. Only if I use perch it breaks the grid.

You need to diff the working and not working versions to see what's changed. Generally Perch will just output what's in your templates and content. All of that should be under your control.

Thank you it's solved . It was a matter of renaming classes asyncronously. omg