Forum
Blog and Blocks broken since update
I updated a site to the newly released version of the blog app, updating Perch core in the process, and now have encountered a weird thing when using a freeform template that makes use of blocks to create a blog post.
Clicking any of the links to create a block presents the title of the new block but no input field. I also have two random input fields visible before creating any blocks.
This is my freeform.html blog template located in perch > templates > blog > posts
<article class="h-entry">
<div class="page-header cover <perch:if exists="image"><perch:blog id="theme" label="Cover Photo Colour" type="select" options="dark,light" order="3" />" style="background-image: url(<perch:blog id="image" type="image" label="Cover Photo" order="2" />);background-size: cover;"</perch:if>">
<div class="container question-title">
<h1><perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" order="1" /></h1>
</div>
</div>
<div id="intro">
<div class="container">
<perch:blog id="excerpt" type="textarea" label="Excerpt" markdown="true" order="4" size="s" />
</div>
</div>
<div id="content" class="container">
<perch:blocks>
<perch:block type="text" label="text">
<perch:blog id="text" type="textarea" label="Text" markdown="true" editor="markitup" imagewidth="640" imageheight="480" />
</perch:block>
<perch:block type="largeheading" label="large heading">
<h4><perch:blog id="heading" type="text" label="heading" required="true" title="true" /></h4>
</perch:block>
<perch:block type="mediumheading" label="medium heading">
<h5><perch:blog id="heading" type="text" label="heading" required="true" title="true" /></h5>
</perch:block>
<perch:block type="smallheading" label="small heading">
<h6><perch:blog id="heading" type="text" label="heading" required="true" title="true" /></h6>
</perch:block>
<perch:block type="pullquote" label="pull quote">
<blockquote class="<perch:blog id="class" type="select" options="Pull left|left,Pull right|right,Centre|centre" label="Alignment" order="2" />">
<perch:blog id="quote" type="textarea" size="xs" label="Quote" />
</blockquote>
</perch:block>
<perch:block type="image" label="full image">
<img class="full-image" src="<perch:blog type="image" id="LargeImage" label="Image" width="1400" />" alt="<perch:blog type="text" id="alt" label="Description" help="e.g. Photo of MD John Smith with his best wig on" title="true" />" />
</perch:block>
<perch:block type="mediumimage" label="medium image">
<div class="medium-image <perch:blog id="class" type="select" options="Pull left|left,Pull right|right,Centre|centre" label="Alignment" order="2" />">
<img src="<perch:blog type="image" id="MediumImage" label="Image" width="700" />" />
<perch:if exists="caption"><p class="caption"><perch:blog type="textarea" size="xs" id="caption" label="Image Caption" /></p></perch:if>
</div>
</perch:block>
<perch:block type="twoimages" label="two images side by side">
<div class="two-images">
<img class="left" src="<perch:blog type="image" id="LeftImage" label="Left Image" width="700" />" />
<img class="right" src="<perch:blog type="image" id="RightImage" label="Right Image" width="700" height="500" />" />
</div>
</perch:block>
<perch:block type="smallimage" label="small image">
<div class="small-image <perch:blog id="class" type="select" options="Pull left|left,Pull right|right,Centre|centre" label="Alignment" order="2" /> ">
<img src="<perch:blog type="image" id="SmallImage" label="Image" width="250" />" />
<perch:if exists="caption"><p class="caption"><perch:blog type="textarea" size="xs" id="caption" label="Image Caption" /></p></perch:if>
</div>
</perch:block>
<perch:block type="youtube" label="YouTube Video">
<div class="video-container">
<perch:blog id="YouTube" type="youtube" label="YouTube URL" output="embed" />
</div>
</perch:block>
</perch:blocks>
<div class="author">
<perch:if exists="author_image">
<img src="<perch:blog id="author_image" type="image" label="Author Image" type="hidden" />" width="60" />
</perch:if>
<p class="meta">Posted
<perch:if exists="authorGivenName">
by <a href="/blog/archive.php?author=<perch:blog id="authorSlug" type="text" />"><span class="p-author h-card"><perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" type="hidden" /></span></a>
</perch:if>
on <time class="dt-published" datetime="<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Meta information" />"><perch:blog id="postDateTime" type="date" time="true" format="%d %B %Y" /></time>.</p>
<p>This post has been tagged <perch:blog id="postTags" /></p>
<perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes">
<a href="archive.php?cat=<perch:category id="catSlug" type="slug" />" class="p-category">
<perch:category id="catTitle" type="text" />
</a>
</perch:categories>
</div> <!-- Close Author -->
</div> <!-- Close Container -->
</article>
This is what it looks like when first arriving on the edit screen for a new post:
Here is what happens when I create a block:
Which versions were you updating from?
If you inspect the 'random' fields, what IDs do they have?
I believe I updated from the most recent version of the blog app and from 2.8.12 of Perch.
The first mystery field is for the author slug, not sure where it's getting that from, and the second is for tags, which doesn't seem be labelled properly.
When I add a block and inspect it this is what the html looks like:
This is then followed by .block-add-bar.
You can add
type="hidden"
to those fields.Of course, thanks Drew. Any ideas on why the Blocks are not showing their content fields?
I would really appreciate some guidance as to why my blocks are not loading correctly? It is holding up a project I cannot get them to work when they were prior to running this blog app update.
I've tried replacing all my blocks, even copying the code from the support document into a fresh block and it still does the same thing.
I just updated to the latest version of Perch on this site and had this debug, wondering if it's related. Although the sets updated there were a number of errors in the debug.
Investigating further into this as nothing I do seems to have any effect. This is the html of a block when I try to add one.
It seems to be hiding the inputs, which explains why they are not visible but nothing in my templates tells them to be hidden.
I am still none the wiser on this. No matter what I do I cannot get a blog post with blocks to show the actual inputs in the blocks. Is there any idea what may be causing it please!? It has been two months since I originally asked for support on it.
It's working completely fine here. Are you able to reproduce it on a fresh test site? We can't reproduce your problem at all.