Jump to content

zkriszti

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by zkriszti

  1. For some reason, the Blog Module sample file blog-tag.php gave me an error stating "Error: Call to a member function count() on a non-object (line 830 of C:\wamp\www\...\site\assets\cache\FileCompiler\site\modules\MarkupBlog\MarkupBlog.module) ". With your code above @MadeMyDay, it now works like a charm! :cool:

    (I've put it here for reference for those searching later).

  2. I seem to have another issue, and as far as I've found out (having searched all the way through the forum), this is related to the small version of posts stripping tags. More exactly, I can't get 'post_small_allowable_tags' to work. I just can't seem to get the "view more" anchor appear.

    The affected page is a blog-category view (based on the module's blog-category.php), where I get a few post excerpts from a given category, ideally with adding that "view more" tag. Which is nowhere to be found in the output. :(

    The relevant parts of my template file look like this:

    $options = array('post_small_allowable_tags' => '<p><a>', 'post_more_text' => 'tovább');
    $content .= $blog->renderPosts($posts, true, $options);

    Then the html output looks like this:

    <div class="summary">
      <p>It's my blogpost and here is a 
        <a href="http://...">link to my another article in the text working fine.</a>
        Some more text, some more text, some more text.</p>
    </div>

    It is strange, because inside .summary I do have <p> and <a> tags, but <a> is only for the content (because there is a link in the referred article itself). But I don't have "view more" at the end of the summary.

    Thank you very much for your help in advance!

     

  3. OK, so the host provider told me that I had done something wrong (had chosen the wrong server) when creating the database, then just a minute later they informed me that they have corrected the error. (?) :o This made it possible to log in to phpMyAdmin, and import my db without any problems, but the frontend was still inaccessible giving me 404 error (as far as I got it, it was some kind of mismatch between index.php and config.php).

    No magic helped there, so I deleted all the site files via FTP, then reuploaded them. Of course, here I needed to modify config.php accordingly (as I reuploaded a localhost installed site). After this step, my frontend came alive & working. :rolleyes:

    Still struggling with some minor issues, but that is for another day. :) 

    • Like 4
  4. 14 minutes ago, EntitySelf said:

    Sorry, I made an updated version for you, check my previous post.

    Yes, most likely the credentials, host name or port is incorrect.

    [edit again]

    You are using an IP address now, did you try using a hostname? 

    127.0.0.1 = localhost

    etc, I remember that this actually does matter when connecting to a DB!

    OK, I haven't yet seen the third version that you have posted here, but now tried with that one. It says now:

    " 404 page not found (no site configuration or install.php available) "

  5. 6 minutes ago, EntitySelf said:

    Try this: 

    Create a PHP file with this script (https://gist.github.com/chales/11359952), enter the right credentials and test it, it is likely not working but now you can be sure it is not PW. Try to find the correct settings for your database at your hostings provider FAQ.

    I get this:

    " Warning: mysql_connect(): Access denied for user '...'@'[IP]' (using password: YES) in /.../dbtest.php on line 8
    Unable to Connect to 'sql' "

    - so in this case the problem most probably lies at the histing provider side, ami I right?

  6. Hello,

    I've been trying to move a site from localhost to live environment. I have done everything step by step as Ryan suggested here. I get the following error message:

    "Exception: SQLSTATE[28000] [1045] Access denied for user" (see attached image).

    What I have tried / made sure about:

    • my db credentials in site/config.php are OK, I have checked a thousand times
    • $config->userAuthSalt untouched
    • changed $config->httpHosts value (from array('localhost'); to array('mydomain.hu'); )
    • I have deleted then reuploaded all site files
    • .htaccess contains only the default ProcessWire directives, nothing else special
    • emptied the site/assets/sessions folder
    • searched this forum and Google extensively before posting... ;)

    ...and still getting the error. This was just a regular localhost installation on wamp with no exotic settings like multisite, etc.

    Could you please point me in the right direction? Thank you very much in advance. 

     

     

     

    siteerror2.PNG

  7. On 7/24/2017 at 10:32 PM, kongondo said:

    Your $urls is a already a PageArray so you should be able to loop through that to grab each category Page's blog_category_image.

    I still seem to be stuck with this. I most probably misplace something, but what I get as a result is the right URLs, the right titles BUT the very same image for all of my categories (see attachment). The image that is displayed belongs to the last category (the one with the highest ID), bit it is displayed for all the 3 of them. even though they all have their respective images. For test purposes, if I display the ID on the frontend, I get the ID of the last category for all the 3 categories.

    The relevant part of my code (based on your original renderNav() function) looks like this:
    (because I need to display the images together with the urls and category titles, I suppose that this is where I should get my blog category images as well, and not in a separate loop). 

    foreach($nav as $url => $title) {
                
                        $imagelocation = $page->blog_category_image->url; 
                                                         
    					if($url == $currentURL) $out .=
                            "<li class='on category-item'>
                                <a class='on category-box' href='$url'>
                                    <img src='$imagelocation' />
                                    <span class='category-title'>$title</span>
                                    <span></span>
                                    
                                </a>
                            </li>";
                
    					else $out .= 
                            "<li class='category-item'>
                                <a class='category-box' href='$url'>
                                    <img src='$imagelocation' />
                                    <span class='category-title'>$title</span>
                                    <span></span>
                                </a>
                            </li>";
    		}

    I greatly appreciate your help. :) 

    pw_output.PNG

  8. This might be more of a PHP-question, but strongly related to the renderNav() function of the blog module.

    My blog starting page enumerates my Categories using renderNav(), which works fine (only a category list, no post-listing here yet). But to add a visual tweak to it, I have added an image to each of my categories (one single image to each of the categories, each has its own). Now what I need is a modified html output so that the images should be clickable blocks instead of just the category titles. (Category titles would show up on the image with some transparent background). I think this is quite a frequent visual pattern.

    My template file looks like this:

    $blog = $modules->get('MarkupBlog');
    
    $urls = $pages->find('template=blog-category, limit=0');
    $category_list = $blog->renderNav('', $urls, '', false);
    
    $content = $category_list;

    ...and output html by $content should look like something like this (instead of just a simple list now) :

    <li>
      <a href="[category-url]" class="category-box">
        <img src=[blog-category-img-url] />
        <span class="category-title">[category title here]</span>
      </a>
    </li>

    ...and then I can write the necessary CSS to accomplish the desired visual output.

    So how do I go about it? How do I make (or extend) renderNav() to give me an output like this? Basically, I want it to get not just the title but my "blog_category_image" custom field, too. Any help is greatly appreciated. :)

     

  9. @kongondo, I have one more question. :) I have not found an option in the admin backend to modify whether I want to output the number of comments on the top or at the bottom. I have found this part of the markup in the MarkupBlog.module, where it refers to $commentsCountTop and $commentsCountBottom boolean variables, so I suppose they should exist as a setting somewhere... I've been looking for this a whole day back and forth, but can't find it... It would be easy to just modify MarkupBlog.module accordingly, but 1. it would contradict the logic (why would this option be a variable then?) 2. I suppose that it got overwritten during a possible update. Thank you in advance. :)

     

  10. On 6/26/2017 at 7:39 AM, kongondo said:

    Hi @zkriszti. Seems you installed blog with the option 'blank template files', hence there is no demo content. Blog's documentation, found here, should help you along. It's incomplete but sufficient to get you started.

    Yes, thank you :) meanwhile I realized this being the problem, so the blog is up and running by now, waiting for my content... :)

  11. Hi All,

    I am mainly specialized in frontend-development and have limited experience with PHP. I just started out with Processwire, so my problem might be really basic and specific to the "PW-logic", but now I feel I got stucked with the below problem.

    I am trying to rebuild a site (previously WP) on localhost, and I am looking to set up a blog within this. All my "normal" pages are showing up fine, except the blog. When navigating to the blog, a white screen is rendered. My page header (menu, search box...) and footer aren't rendered either. HTTP status is 200 (OK).

    Kongondo's blog components (MarkupBlog, ProcessBlog) are installed, I have read the instructions and everything went fine with the installation, my Apache and PW logs having been both error-free regarding this case. I have turned on debugging in config.php. I have an "Example post" with some dummy content, so that one at least should be visible. 

    In my templates folder, the blog-related files are empty except for the comments ("* A blank template file to get you up and running quickly with your Blog
     *"). However, in site\modules\MarkupBlog, I have files with regular php-codes. In templates, I have "blog", within which I have two fields, "title" and "blog_body".

    Do I miss something regarding templates and template-files? Or is it a different issue?

    Thank you in advance!

     

     

     

     

     

     

     

     

×
×
  • Create New...