Posts by dosa

    Thanks @JawW for pointing that out. I think I had it on the wrong directory and was editing another author.html. Oops.


    Yep ellimondo I was going to do just that, but I realized having the field in that logical place in the Author template makes the most sense for this purpose. Thanks!

    Hmm, no. It acts weird with that option on - showing half a link, and a messy layout of the posts. And it's still looping.


    Here's a screen of the looping output, showing many "posts" DIVs, when there should only be one.


    Here is the search-result.html code. I must have missed something inside here...

    In my blog posts, I'm showing the date like this:

    Code
    1. <perch:blog id="postDateTime" format="%B %d, %Y" />

    But I'd like to shorten all the months down to show as 3 or 4 letter words instead.....January = JAN and February = FEB and so on.


    How do I do this?

    UPDATE: it's working, but because I hidden a variable in testing on the 'blog_search_result.php" page to this:

    PHP
    1. <?php
    2. perch_blog_custom([
    3. 'template' => 'post_search_result',
    4. 'filter' => 'postURL',
    5. // WORK WITH THIS HIDDEN 'value' => perch_layout_var('url', true),
    6. ]);
    7. ?>

    Everything seems to be working, the showall has all the data, but still the <li>'s are empty. Perhaps I have the syntax wrong? I was already filtering via the apps array, but it looks like my syntax is different. (neither work though, same results)


    PHP
    1. <?php
    2. $query = perch_get('q');
    3. perch_content_search($query, array(
    4. 'apps' => ['PerchBlog'],
    5. 'template'=>'search-result.html'
    6. ));
    7. ?>


    No errors are showing in the debug mode either. It confirms the template being used. And that code is on post_search_result.html:


    Code
    1. <div class="image"><a href="<perch:blog id="postURL" />"><img src="<perch:blog id="image" />" alt="<perch:blog id="postTitle" />"></a></div>
    2. <div class="content">
    3. <h2><a href="<perch:blog id="postURL" />"><perch:blog id="postTitle" /></a></h2>
    4. <perch:if exists="subtitle"><p><perch:blog id="subtitle" striptags="true" /></p></perch:if>
    5. </div>

    hi hus_hmd - I'm back on this search since I've migrated the site to a new server, now using Perch 3 Runway. And the key, I have moved the location and renamed from /community to /about/newsroom


    So now, of course using the same templates as above, I'm getting empty results. I imagine it's simply missing a connection somewhere with the rename, but I can't seem to find it. Hope you can help!


    Here's a summary:


    templates/search/search-results.html


    templates/layouts/blog_search_result.php

    PHP
    1. <?php
    2. perch_blog_custom([
    3. 'template' => 'post_search_result',
    4. 'filter' => 'postURL',
    5. 'value' => perch_layout_var('url', true),
    6. ]);
    7. ?>


    templates/blog/post_search_result.html

    Code
    1. <div class="image"><a href="<perch:blog id="postURL" />"><img src="<perch:blog id="image" />" alt="<perch:blog id="postTitle" />"></a></div>
    2. <div class="content">
    3. <h2><a href="<perch:blog id="postURL" />"><perch:blog id="postTitle" /></a></h2>
    4. <perch:if exists="subtitle"><p><perch:blog id="subtitle" striptags="true" /></p></perch:if>
    5. </div>


    templates/search/search-form.html

    Code
    1. <perch:form id="search" method="get" role="search" action="/about/newsroom/search">
    2. <div>
    3. <perch:input type="search" id="q" placeholder="Search Newsroom" />
    4. <perch:input type="submit" value="Search" class="button button-small" />
    5. </div>
    6. </perch:form>


    The problem is when I search, the result is blank, as if it's not finding the PerchBlog source. However, the page still shows how many results, and an empty list of all the results.


    Also, FYI, in the CMS Settings panel, I have the "Blog post page path" set as /newsroom/{postSlug} ....this is intentional, my client wants the links this way. Could this be throwing off the connection to the search results? Everything else is working.

    Hi! Is there a way to use BOTH options in a select menu, where in the example below I can use the "Apple" option for one piece of content, but the "apple" content for another. I know the first variable is for the CMS editors, but can that data also be used?

    Code
    1. <perch:content id="fruits" type="select" label="Fruits" options="Big Apple|apple,Round Orange|orange,Green Pear|pear" >

    For context, I want to use the capitalized version of the word to display the title for the HTML for the end user. But I also want to use the lowercase version to add a class to the DIV the option is in. This way, the CMS editor doesn't have to choose 2 different select boxes for something very similar.

    I've got a blog with an author badge that has the 'given name', 'family name', and 'biography'. But can I add another field for their "title" in the company?


    I want to use the title with the name, such as "Bob Smith, CEO"


    1. How to I add a custom field to the Authors edit page in the CMS

    2. How do I then display that along with the other info.


    Here is what I have now:


    Code
    1. <perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" />

    So I imagine it's something like....

    Code
    1. <perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" />, <perch:blog id="authorRole" />

    ...where I would set the 'authorRole' in the edit template for editors.


    Thoughts?

    Cool that worked. Thanks!


    Though I realize the tags are limited, as I can't change them to random, or the order. Are their other display options I have for the tags?


    For context, this is for a "tag cloud" for a blog. I want to show 10 tags, but have them random for each load (since there are 50+ tags, I want to show some but not all). Does that make sense?

    hi! I'm using the perch_blog_tags but I don't know how to limit the amount of tags shown. So I've got this working, but too many tags showing:


    PHP
    1. <?php $tags = perch_blog_tags('custom_tag_link.html', true); ?>

    But how do I reference the blog_tags in a blog_custom?

    PHP
    1. <?php
    2. perch_blog_custom(array(
    3. 'count' => 10,
    4. 'template' => 'custom_tag_link.html',
    5. ));
    6. ?>