block-loop doesn't work for me

Non-bug-related support questions (How do/should I ... ?).
Post Reply
User avatar
mediafant
Posts: 132
Joined: Sun Jan 22, 2012 6:31 pm
Location: Germany
Contact:

block-loop doesn't work for me

Post by mediafant » Tue Sep 22, 2015 6:13 pm

Sorry for this. I have done a lot of time without any problem and now it doesn't work and I have no idea what the reason is.

Code: Select all

    <?php
    $counter = 0;
echo "ALFA";
    while ($this->block('content')->loop()) {
echo "BETA";
        if($this->editmode) {
            echo $this->select("blocktype",array(
                "store" => array(
                    array("wysiwyg", "WYSIWYG")
                ),
                "reload" => true,
                "width" => 500
            ));
        }
        $type = $this->select("blocktype")->getData();
        if($this->select("blocktype")->isEmpty()) {
            $type = "wysiwyg";
        }
        $this->template("default/blocks/".$type.".php",array('counter'=>$counter));
        $counter++;
    }
    ?>
</div>

In the backend previewmode I can see "ALFA", "BETA" and the output of wysiwyg but in frontend there is only "ALFA". Why the block doesn't work in the frontend.

Pimcore Build: 3450
Andreas Wulf (http://www.mediafant.de) - Webentwickler

User avatar
johan.lindgren@ateles.se
Community Support
Posts: 871
Joined: Fri Apr 27, 2012 8:18 am
Location: Sweden
Contact:

Re: block-loop doesn't work for me

Post by johan.lindgren@ateles.se » Wed Sep 23, 2015 3:29 pm

What if you comment out the row with the template include, does it work then?
/Johan
---------------------------------------------------------------------
Ateles Consulting AB - a Pimcore Professional Partner

User avatar
mediafant
Posts: 132
Joined: Sun Jan 22, 2012 6:31 pm
Location: Germany
Contact:

Re: block-loop doesn't work for me

Post by mediafant » Wed Sep 23, 2015 3:46 pm

It must be a problem with system-settings or pimcore-settings.
I installed new pimcore on online-Server and copied website/controller and views there and this works.
I must check my local machine.

Andreas
Andreas Wulf (http://www.mediafant.de) - Webentwickler

User avatar
johan.lindgren@ateles.se
Community Support
Posts: 871
Joined: Fri Apr 27, 2012 8:18 am
Location: Sweden
Contact:

Re: block-loop doesn't work for me

Post by johan.lindgren@ateles.se » Wed Sep 23, 2015 10:23 pm

Strange, might be content related. Please report if you find the exact cause.
/Johan
---------------------------------------------------------------------
Ateles Consulting AB - a Pimcore Professional Partner

Post Reply

Return to “General Support”



Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest