Jump to content

cmscritic

Members
  • Posts

    127
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by cmscritic

  1. That worked, thank you sir!

    Now, because I wouldn't want you to think you could stop using your brain for two seconds, I have a new question. :)

    I also just tried adding some code for sharethis.com (sharing buttons) but it appears I'm editing the wrong files because I can't get it to work. Their site tells me to add this code at the bottom of the post:

    <span class='st_sharethis_hcount' displayText='ShareThis'></span>
    <span class='st_facebook_hcount' displayText='Facebook'></span>
    <span class='st_googleplus_hcount' displayText='Google +'></span>
    <span class='st_twitter_hcount' displayText='Tweet'></span>
    <span class='st_linkedin_hcount' displayText='LinkedIn'></span>
    <span class='st_email_hcount' displayText='Email'></span>
    

    so I assumed I'd add it under this chunk of code in /site/templates/markup/post.php:

    <div class='post-body'>
    <?php
    if($small) {
    echo substr($page->summary, 0, -4) . "… <a class='more' href='{$page->url}'>" . __('View More') . "</a></p>";
    } else {
    echo $page->body;
    // if the post has images and no <img> tags in the body, then make it a gallery
    if(count($page->images) && strpos($page->body, '<img ') === false) include("./gallery.php");
    }
    ?>
    </div>
    

    It then tells me to add this code into my site header:

    <script type="text/javascript">var switchTo5x=true;</script>
    <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
    <script type="text/javascript">stLight.options({publisher: "c29ec199-09ee-40fc-ae3d-746c240bb69a"});</script>
    

    so I edited the file /site/templates/head.inc and put it here:

    <!--
    This website is powered by ProcessWire CMF/CMS.
    ProcessWire is a free open source content management framework licensed under the GNU GPL.
    ProcessWire is Copyright 2012 by Ryan Cramer / Ryan Cramer Design, LLC.
    Learn more about ProcessWire at: http://processwire.com
    -->
    <script type="text/javascript">var switchTo5x=true;</script>
    <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
    <script type="text/javascript">stLight.options({publisher: "c29ec199-09ee-40fc-ae3d-746c240bb69a"});</script>
    </head>
    

    This does not appear to work, however, and nothing loads. What am I missing?

    • Like 1
  2. The opening <p> should already be there since its a TinyMCE field. But if there were any posts still in place that hadn't yet been saved with the new TinyMCE field, then this could account for it.

    I think the fix would be to go and save all the posts that don't yet have TinyMCE markup. Or account for either possibility in the code:

    if(strpos($page->summary, '<p>') === 0) echo substr(trim($page->summary), 0, -4);
    else echo "<p>" . $page->summary;
    echo "… <a class='more' href='$page->url'>" . __('View More') . "</a></p>";
    

    The changes to the summary work fine, no issues there, but the changes you mentioned for main.inc break the styling on the whole site so there must be something missing in that code?

  3. Ryan,

    It looks like the changes we made to /site/templates/main.inc caused the styling on the site to get buggered up. As soon as I reverted that piece, the styling came back. Thoughts? I assume it's a missed closing tag somewhere but I'm not adept enough to know where.

  4. Nevermind. I just figured this out on my own. Apparently, I just needed to change the field "Summary" to allow it to use TinyMCE and remove text formatting and now she works like a charm just like an excerpt field.

    Did I mention I love ProcessWire?

    • Like 3
  5. Hi Ryan,

    Don't worry, I know the blog profile doesn't showcase what ProcessWire was intended for. I am primarily using it as a starting point for my personal site, which I've been tweaking steadily.

    Quick question for you. I implemented these changes that WillyC recommended but the excerpts are now far too small:

    in /site/templates/home.php, I changed

    $content = $page->body . renderPosts("limit={$page->quantity}");
    

    to this:

    $content = $page->body . renderPosts("limit={$page->quantity}", true);
    

    Is there a way to perhaps place a <read more> link of some kind in the text editor or limit the # of characters in the post shown as excerpts? The issue is that the excerpt is two lines of text and no pictures. I'm trying to find a happy medium here without showing the entire post on the front page. I'd prefer to capture the first picture in the post and the first paragraph and then have a "continue reading" link.

    You can see what I'm getting now here: That Critic Guy

  6. Something I discovered with this profile (which I'm almost done implementing by the way) is that if you insert an image into a post and resize the window, sometimes the image overlaps the right sidebar. I used a neat CSS trick to make my images, regardless of size, automatically resize with the windows.

    Here is the CSS:

    img {
       max-width: 100%;
       height: auto;
       width: auto\9; /* ie8 */
    }
    

    This makes things nice and neat.

    • Like 1
  7. I know the bulk of you are coders and likely can figure this out on your own but for those who are not, I thought I'd throw this solution in here just in case someone else has a need for it.

    I created a simple widget-google-plus.php file for those who want to add a Google Plus widget to their sidebar (or elsewhere) in Processwire. To use, simply upload the attached widget, changing the profile URL to yours and add the CSS / tweak as needed.

    I've no clue how to build a module so I am doing this as a tutorial.

    First the logic:

    If you are anything like me, you crave customization. I hated the fact that Google wouldn't let me remove the border from around their google plus badge so I decided to create a solution of my own.

    Here's how it looks straight from Google:

    Google+-Badge-Google+-Platform-—-Google-Developers-Mozilla-Firefox_2012-10-23_16-35-15.jpg

    To get rid of this obnoxious border, I created a new widget (attached) with this code:

    <div id="googleplus_widget">
    <span>
    <div class="g-plus" data-width="275" data-height="69" data-theme="light" data-href="https://plus.google.com/your-profile-id-goes-here"></div>
    <script type="text/javascript">
    (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
    </script>
    </span>
    </div>
    

    As you can see, it's wrapped in divs which I then styled with the following CSS:

    #googleplus_widget{
    width: 280px;
    height: 50px;
    }
    #googleplus_widget span{
    width: 200px;
    height: 50px;
    float: left;
    overflow: hidden;
    background: #fff;
    }
    #googleplus_widget span div{
    margin: -1px 0 0 -1px !important;
    position: relative;
    }
    

    To use, simply modify the attached widget-google-plus.php with your google plus profile URL, upload to your ProcessWire installations /site/templates directory and go to Setup and then Templates within the back end of your install.

    The new widget php file should show up under the "Templates found in /site/templates/*.php" , check it off, click add template and then add it to your sidebar if you choose to do so. That's it.

    Hope that helps someone. I know it's a minor contribution but at the very least, this is recorded for me to reference later when / if I forget ;)

    BTW. If there's an easy way to make this into a module, I'd love to be able to do so even if just for myself and future newbs.

    widget-google-plus.php

    • Like 7
  8. or.you could hide w css if you like.better

    body.template-home #bodycopy > h3:first-child {
    display: none;
    }
    

    but i like better.to edit posts.php

    I'm not big on hiding with CSS either, the issue of course being that it executes code unnecessarily. Your solution definitely seems to work without a hitch.

  9. Fabulous! Worked like a charm, thank you! Actually, one problem is that now it shows: Posts 1 to 1 of 1 at the top of the posts on the home page. Anyways to prevent this? Obviously it's useful on archive pages, search results, etc but not on the home page. See http://thatcriticguy.com(work in progress) to see what I mean.

  10. I'm stuck on one thing in the blog profile (otherwise, it's been fantastic so far and I'm enjoying using it.)

    I added a summary field to the blog posts but can't figure out how to make it so that the home page only shows the summary and not the complete body of my posts? I'm looking to use the summary field for excerpts for instance..

    I added the field "summary" to the "post" template and everything shows up fine there and I went to modify the template for "home" assuming that I'd be able to find the answer but removing "body" doesn't seem to do anything. Can someone point me to which template I should be modifying so that it just shows the summary?

  11. Just read it quickly through and it's looking good!

    I'm on a mobile here, but still a couple of small things on the review: access rights are defined with the page's template (says so in your screenshot too ;)) and can't be modified editing the page itself, unless the template is changed to another.

    And then the modules are only checked from your local installation by pressing that button. There is a Module Manager module by Soma though that has the function you we're describing (and much more).

    Still, great work you've done here!

    For the access rights bit, can you tell me which line in my review you are referring to so I can change it? Thanks!

  12. Just a quick note to say that I'm going to attempt to set up my "online visibility / seo" business site (thatcriticguy.com) using this profile / processwire. I'll likely be back offering my suggestions soon. Might even slap up a review on CMS Critic while i'm at it. :)

    • Like 5
  13. Personally, I have to say I'm quite surprised as to how many votes everyone is getting, but we've got lots of time.

    Something worth pointing out is that some people are voting multiple times using different accounts (they might vote once with facebook, once with linkedin, once with twitter and once with google+) and it will make the votes look padded but when I do the final tally, those 4 votes will only count for 1. You can see who votes and the duplicates by clicking on the number beside the thumbs up.

    So regardless of what the numbers really look like, there will be some corrections. This is one of the reasons I am using list.ly is it makes people log in to vote.

    I think everyone will find it fair in the long run.

    • Like 2
  14. Awards like these are more like voting competitions than actual "which cms is best" competitions, but very nice to see many smaller projects getting nice coverage there. Actually quite a few cms that I wasn't aware of before. Great work Mike!

    Normally they are voting contests yes but as I mentioned, I'm doing this in two ways .. One for People's Choice in which case, voting counts and another which is Critic's Choice in which the judges will decide and votes won't matter.

    I'm not looking to become another Packt Open Source Awards type deal. That's one of the reasons I started these, so smaller systems or communities have equal chances.

    • Like 4
  15. I am pulling down the existing polls and redoing them with list.ly. Will be back up in a moment. You will need to resubmit your votes. Apologies for the inconvenience. Votes count for the people's choice segment, not for the critic's choice ones. I created two so that community size wasn't a factor.

    • Like 1
  16. Mike, maybe for next year's CMS awards we can get it setup on Form Builder, which keeps out spam with honeypots, Akismet and a Turing test. The advantage of honeypots and Akismet are that the user never knows there are spam prevention measure in place (unless they submit spam), as it all happens beyond their view. The turing test option is within their view (if you decide to use it), but it's up to the administrator to decide how simple or difficult to make the test. Recaptcha would qualify as an extremely difficult Turing test. :) I don't blame you for using recaptcha. If that was the only choice I would choose it in a heartbeat over an unprotected form. Having built a whole lot of forms over the years, spam would fall near the top of my list of considerations on any form, so I respect use of recaptcha even if it's become a lot more difficult to solve lately.

    A good suggestion, I'll definitely consider that.

×
×
  • Create New...