Forum
imageclasses doesn't add the desired class when uploading images through the mar...
Hi,
I'm currently having some troubles adding a class (img-responsive) to all of the images that are being uploaded by my client. The desired outcome is that when my client uploads an image in the editor, perch adds the bootstrap class img-responsive so that the image scales nicely to different screen sizes.
With my current setup that doesn't happen. I've been able to resize the image using the imageheight and imagewidth, but I don't want a fixed size.
<article class="h-entry">
<div class="container-fullwidth">
<section>
<div class="col-lg-12 text-center" id="class-header-text">
<h1 id="meta-header">
<perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" order="1" />
</h1>
<p class="meta" id="meta-par">
Posted <time class="dt-published" datetime="<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Publishing" />">
<perch:blog id="postDateTime" type="date" time="true" format="%d %B %Y" />
</time>
<!-- <perch:if exists="authorGivenName">
by <span class="p-author h-card"><perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" type="hidden" /></span>
</perch:if> -->
<perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes">
in <a href="archive.php?cat=<perch:category id="catSlug" type="slug" />" class="p-category">
<perch:category id="catTitle" type="text" />
</a>
</perch:categories>
</p>
</div>
</section>
</div>
<div class="container-fullwidth">
<section class="">
<div class="description e-content">
<perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="markitup" markdown="true" size="xxl autowidth" required="true" imageclasses="img-responsive"/>
</div>
</section>
</div>
</article>
<perch:blog id="excerpt" type="textarea" label="Excerpt" markdown="true" order="3" suppress="true" size="s" />
Diagnostic report
SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='f24b5e907f65cfbaad7f304f4c4f694f' LIMIT 1
UPDATE perch3_users SET userHash='5fddc01e79ff0ad3fc133233afe7ed0e' WHERE userID='1'
[32] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[8] SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[0] SELECT COUNT(*) FROM perch3_blog_comments WHERE commentStatus='PENDING'
[1] SELECT * FROM perch3_blog_authors WHERE authorEmail='johanerlandsson2@gmail.com' LIMIT 1
[1] SELECT * FROM perch3_blog_posts WHERE postID=4
[1] SELECT * FROM perch3_blog_sections ORDER BY sectionTitle ASC
[1] SELECT * FROM perch3_blogs ORDER BY blogTitle ASC
[1] SELECT * FROM perch3_blogs WHERE blogID=1 LIMIT 1
[1] SELECT * FROM perch3_blog_sections WHERE blogID='1' ORDER BY sectionTitle ASC
Using template: \templates\blog\post.html
Edit mode: edit
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[3] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='perch_blog' LIMIT 1
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: \addons\apps\perch_blog\modes\edit.post.php
[1] SELECT * FROM perch3_resources WHERE resourceID='77' LIMIT 1
Array
(
[assetID] => 77
[title] => Fitness runner
[_default] => /perch/resources/fitness-runner.jpg
[bucket] => default
[path] => fitness-runner.jpg
[size] => 770080
[w] => 5472
[h] => 3648
[mime] => image/jpeg
[sizes] => Array
(
[thumb] => Array
(
[w] => 150
[h] => 100
[target_w] => 150
[target_h] => 150
[density] => 2
[path] => fitness-runner-thumb@2x.jpg
[size] => 17310
[mime] => image/jpeg
[assetID] => 78
)
[w50h50c1] => Array
(
[w] => 50
[h] => 50
[target_w] => 50
[target_h] => 50
[crop] => true
[density] => 1
[path] => fitness-runner-w50h50.jpg
[size] => 1883
[mime] =>
[assetID] => 79
)
)
)
[5] SELECT * FROM perch3_categories c, perch3_category_sets s WHERE c.setID=s.setID AND s.setSlug='blog' ORDER BY catTreePosition ASC
Queries: 19
Memory: 3.5693
Array
(
[type] => 2
[message] => count(): Parameter must be an array or an object that implements Countable
[file] => C:\xampp\htdocs\perch\core\lib\PerchFieldTypes.class.php
[line] => 43
)
Can you post your diagnostic report?