Posts by Splenda

    When I use the above php with perch_content(), the output for my non shared blocks is repeated.

    Like this:

    Block 1

    Block 2


    Block 1

    martech_recognition

    Block 2

    Trusted By


    So the second part is correct, I just don't want the first part to show


    And when I use perch_content_create('Content - Main'); - I don't know where in the CMS the editor would edit the region?

    Thanks for help, but I still can't get it working.


    I've tried two things


    First like this:


    With the code like that above, I edit my region <?php perch_content('Content - Main'); ?> and give it the template block-test.html - And I'm able to have it output the content almost as I want, but it duplicates the non shared region. To clarify, I have a block that is some text, then a shared region selected, then some more text, then a second shared region - and it outputs as:

    First text
    First shared
    second text
    second shared

    first text - again

    second text - again


    I also tried the code as follows:



    But when I do it like that, I don't know how to edit 'Content - Main' as it doesn't show up as a region.


    If I select a the 'Content-Top' region and apply block-test.html template to it then the text I add shows up in the region, but then where <?php perch_content_custom('Content - Main'); ?> is just the following:

    The template <code></code> could not be found.

    The template <code></code> could not be found.


    I feel like I'm soo close, but obviously still missing something.

    I'm super stuck... I tried following This Thread which outlined exactly what I'm trying to do; which is allow my editor to select shared regions and place them on the page using blocks.


    Here's where I ended up, and I can't get it to work.


    Then, when editing the region 'Content - Main' I choose my blocks filled template called block test



    The shared-test.html looks like this:


    HTML: shared-test.html
    1. <perch:if exists="Recognition">
    2. <perch:content id="Recognition" type="checkbox" label="Show MarTech Recognition" suppress>
    3. <perch:content id="sharedregion_recognition" type="hidden" html>
    4. </perch:if>
    5. <perch:if exists="Trusted_by">
    6. <perch:content id="Trusted_by" type="checkbox" label="Show Trusted By" suppress>
    7. <perch:content id="sharedregion_trusted_by" type="hidden" html>
    8. </perch:if>


    And just if the information is needed, my region keys are "martech_recognition" and "Trusted_by"


    I've seen places that say something along the lines of <?php perch_content('Content - Main'); ?> should be perch_content_custom - but then I have no clue what array options to have or which other region I would edit that would get my show.


    Any help would be super appreciated!!!

    How would I show related blog posts based on the blog post category? and exclude the current post?


    I tried the below in my post.php, but it always shows the 3 same ones (they seem to be random, but it's the same 3 everytime and I can't see why it's those 3).


    And I know I'm stretching, but is there a way to show completely random posts if there are only 2 or fewer posts from that category?


    PHP
    1. <?php
    2. perch_blog_custom([
    3. 'filter' => '!postSlug',
    4. 'sort-order'=>'RAND',
    5. 'template'=>'homepage_post_in_list',
    6. 'count'=>3,
    7. 'category' => $cat_slugs,
    8. ]);
    9. ?>

    This seems like it may be very basic, or I'm missing something. But I can't seem to be able to add a 'Tags' field to blog posts.

    I imported a blog from wordpress which included Categories and Tags; the categories worked great and the tags were imported too. I can see them when I use <?php perch_blog_post_tags(perch_get('s')); ?>


    But how to I add tags to post.html or edit the ones attached to my existing posts?

    Hi,


    I assumed this would be simple, but here I am...


    Using PerchBlog app, I'm trying to use the category as a class name so that each post has a different look.


    What's the best way to accomplish this?


    PHP
    1. <?php
    2. perch_blog_custom([
    3. 'template' => 'blog/full_post_sort.html',
    4. 'count' => 20,
    5. 'sort' => 'postDateTime',
    6. 'sort-order' => 'DESC',
    7. ]);
    8. ?>
    HTML: full_post_sort
    1. <div class="blog-mix">
    2. <div>
    3. <div class="blog-img mix mixitem [CATEGORY] ">
    4. <img src="<perch:blog id="image" type="image" width="539" height="306" crop="true" />" alt="<perch:blog id="postTitle" />" class="resize">
    5. </div>
    6. <a href="<perch:blog id="postURL" />"><h3><perch:blog id="postTitle" /></h3></a>
    7. <perch:blog id="excerpt" type="textarea" textile="true" />
    8. <a href="<perch:blog id="postURL" />">Read More</a>
    9. </div>
    10. </div>