Jump to content

derelektrischemoench

Members
  • Posts

    35
  • Joined

  • Last visited

Posts posted by derelektrischemoench

  1. Hey guys, I know this thread is somewhat dated; the host of a customer of mine just notified me they will be upgrading all their db servers to MySql 8 by the end of the month. Are there any new experiences on whether these updates will break my sites? The processwire instances I host on this server are v.3.0.165. So I'm kinda curious to know if anyone has had experiences with this combo. I guess eventually I'm going to try this out on my dev machine when I find the spare time to update my MySQL-Server to v8.

    Greetings, derelektrischemoench

  2. Hi @dragan,

    I've tried everything you mentioned, none of it worked / led to any clue as to what the problem might be. My error logs are empty / don't show any error; I already have setup a vhost, checked my hosts file, changed my hosts file, changed my vhost, my apache configs are identical...

    I have no clue as to what could be the problem. I might try to install tracy debugger, although I'm not quite sure as how to achieve this, since I can't access the backend and I don't have composer running. But I'm guessing that this can be done via the api.

    Anyhow, if anyone has further ideas, please let me know; @dragan: thanks so far.

    Greetings derelektrischemoench

  3. Hi @Gideon So, the website is currently hosted on three separate machines; one staging / preview system which is accessible over the internet on  a shared hosting space with strato; a large german hosting provider, also I have setup my two main dev machines which are my PC and my laptop, both running ubuntu 19.10 with apache 2.4.41 and Mariadb 10.3.20.

    My hoster on the other hand uses mysql 5.6.42 which I can't influence or change.

     

  4. Hi guys,

    I'm facing a somewhat strange issue here which I can't quite wrap my head around. 

    I have a PW site in development which runs on three machines simultaneously, one staging server which is accessible as a preview instance for my customer, my PC and my laptop. 

    I have three completely identical settings on each of the three machines (same apache version, same php version, same codebase, same database); however on my PC I am unable to log into the backend. I get no error message or anything, when I try to login; i just get redirected to the login  page. I have already enabled database driven sessions (I enabled them on my laptop, then I dumped the database and copied it to my pc); I have cleared the cache directory; I cleared the sessions in the database; I cleared my browser caches, I tried different browsers, all to no avail; I am unable to login when using my pc, the instances all have the same .htaccess.

    Is there something I'm missing here or does anyone have a clue as to what my issue here might be? I'm using processwire 3.0.123

    Thanks for any input, greetings

    derelektrischemoench

     

    //edit: I've noticed something interesting; despite the directories of my web folders being the same layout; when I open the admin page i get a 404 on the processwire/ resource in the networks panel of chrome; on my laptop I get a  200.... I guess this is where my problem is; but why?

     

     

  5. Hi guys,

    I'm facing a somewhat strange issue here which I can't quite wrap my head around. 

    I have a PW site in development which runs on three machines simultaneously, one staging server which is accessible as a preview instance for my customer, my PC and my laptop. 

    I have three completely identical settings on each of the three machines (same apache version, same php version, same codebase, same database); however on my PC I am unable to log into the backend. I get no error message or anything, when I try to login; i just get redirected to the login  page. I have already enabled database driven sessions (I enabled them on my laptop, then I dumped the database and copied it to my pc); I have cleared the cache directory; I cleared the sessions in the database; I cleared my browser caches, I tried different browsers, all to no avail; I am unable to login when using my pc, the instances all have the same .htaccess.

    Is there something I'm missing here or does anyone have a clue as to what my issue here might be? I'm using processwire 3.0.123

    Thanks for any input, greetings

    derelektrischemoench

     

     

  6. On 12/17/2019 at 1:44 PM, kongondo said:

    Update: Menu Builder 0.2.6

    Changelog

    1. Added the properties numChildren, totalChildren and showMoreText for use with getMenuItems()
    2. Added option maximum_children_per_parent to limit the maximum number of (included) children a menu item can return. Thanks @derelektrischemoench for inspiration/request.
    3. Fixed CSS issue that affected menu items' trash cans in the backend. Thanks @duncan.
    4. Refactored code to improve efficiency.

    In dev branch only for testing.

    I have also updated the docs, especially around getMenuItems().

    @derelektrischemoench,

    See this gist for an example recursive menu builder function that uses maximum_children_per_parent and showMore.

    OK, breaktime over, back to Padloper! :-).

    Hi Kongondo,

    thanks for including my input and change requests :) very cool! I'm gonna give it a try, asap.

    Greetings

    derelektrischemoench

  7. Hi guys, hi @kongondo,

    I have a menu which I built using your code from some pages back:

    Quote
    
    function buildMenuFromObject($parent = 0, $menu, $first = 0) {
        if(!is_object($menu)) return;
    
        $out = '';
        $has_child = false;
    
        foreach ($menu as $m) {
            $newtab = $m->newtab ? " target='_blank'" : '';
            // if this menu item is a parent; create the sub-items/child-menu-items
            if ($m->parentID == $parent) {// if this menu item is a parent; create the inner-items/child-menu-items
                // if this is the first child
                if ($has_child === false) {
                    $has_child = true;// This is a parent
                    if ($first == 0){
                        $out .= "<ul class='mainMenu js-mainMenu clearfix'>\n";
                        $first = 1;
                    }
                    else $out .= "\n<ul class='subMenu js-subMenu'>\n";
                }
    
                $class = $m->isCurrent ? ' class="current"' : '';
    
                // a menu item
                $out .= '<li' . $class . '><a href="' . $m->url . '"' . $newtab . '>' . $m->title;
                // if menu item has children
                if ($m->isParent) {
                    $out .= '</a><span class="icon submenu__expand js-submenu__expand icon-cheveron-down"></span>';
                }
    
                else $out .= '</a>';
    
                // call function again to generate nested list for sub-menu items belonging to this menu item.
                $out .= buildMenuFromObject($m->id, $menu, $first);
                $out .= "</li>\n";
    
            }// end if parent
    
        }// end foreach
    
        if ($has_child === true) $out .= "</ul>\n";
    
        return $out;
    
    }

     

    which works fine, although I have a question regarding the submenus. I have selected to include all native descendants of my page into the submenu. which generates something like this:

    <ul>
      <li> Projects </li>
      <ul class="submenu">
      	<li class="submenuItem">
          Project 1
        </li>
        <li class="submenuItem">
          Project 2
        </li>
        ... -> render all remaining Project objects which are children of the Projects Page
      </ul>

    This, however, bloats my submenu, if I have a lot of projects. Is there some option to limit the amount of projects that are rendered, to e.g. 10 and then provide a link as the last project item which leads to a project list view which displays all projects?

    I just don't quite get the code; e.g. where the code fetches the native descendants of the ``projects`` page.

    Any help would be appreciated.

    Greetings, derelektrischemoench

  8. Hi wbfmnfktr,

    thanks for your input. I tried activating the rewritebase as you suggested. Interestingly, when I activate rewriteBase / and rewriteBase/pw/ I get a 500 with and this apache2 error:

    AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://processwire.localhost/

    If I only activate RewriteBase/ I get a 404. So I assume the 500 is preferable in this case, since it shows some kind of debug message, right? ? 

  9. Hi guys, I'm facing a weird issue here. I cannot access any other page than / or /admin; whenever I try another page I get a 404.

    Interestingly though, I am able to get into the backend and edit my pages and whatnot without any problems. I'm using the standard htaccess bundled with processwire. Is there any solution to this? I have attached my htaccess below.

    Thanks in advance, 
    best wishes 

    derelektrischemoench

     

    Spoiler
    
    #################################################################################################
    # START PROCESSWIRE HTACCESS DIRECTIVES
    # @version 3.0
    # @indexVersion 300
    #################################################################################################
    
    # -----------------------------------------------------------------------------------------------
    # 1. Don't show directory indexes, but do follow symbolic links 
    # 500 NOTE: Some cloud hosting companies don't allow +FollowSymLinks. 
    # Uncomment +SymLinksifOwnerMatch and comment +FollowSymLinks if you have 500 errors. 
    # If that doesn't resolve the error, then set it back to +FollowSymLinks. 
    # -----------------------------------------------------------------------------------------------
    
    Options -Indexes
    Options +FollowSymLinks
    # Options +SymLinksifOwnerMatch
    
    # -----------------------------------------------------------------------------------------------
    # 2. Let ProcessWire handle 404s
    # -----------------------------------------------------------------------------------------------
    
    ErrorDocument 404 /index.php
    
    # -----------------------------------------------------------------------------------------------
    # 3. Handle request for missing favicon.ico/robots.txt files (no ending quote for Apache 1.3)
    # -----------------------------------------------------------------------------------------------
    
    <Files favicon.ico>
      ErrorDocument 404 "The requested file favicon.ico was not found.
    </Files>
    
    <Files robots.txt>
      ErrorDocument 404 "The requested file robots.txt was not found.
    </Files>
    
    # -----------------------------------------------------------------------------------------------
    # 4. Protect from XSS with Apache headers
    # -----------------------------------------------------------------------------------------------
    
    <IfModule mod_headers.c>
      # prevent site from being loaded in an iframe on another site
      # you will need to remove this one if you want to allow external iframes
      Header always append X-Frame-Options SAMEORIGIN 
    
      # to prevent cross site scripting (IE8+ proprietary)
      Header set X-XSS-Protection "1; mode=block"
    
      # prevent mime-based attacks via content sniffing (IE+Chrome)
      # Header set X-Content-Type-Options "nosniff" 
    </IfModule>
    
    # -----------------------------------------------------------------------------------------------
    # 5. Protect ProcessWire system files 
    # -----------------------------------------------------------------------------------------------
    
    <FilesMatch "\.(inc|info|info\.json|module|sh|sql)$|^\..*$|composer\.(json|lock)$">
      <IfModule mod_authz_core.c>
        Require all denied
      </IfModule>
      <IfModule !mod_authz_core.c>
        Order allow,deny
      </IfModule>
    </FilesMatch>
    
    # -----------------------------------------------------------------------------------------------
    # 6. Override a few PHP settings that can't be changed at runtime (not required)
    # 500 NOTE: Try commenting out this entire section below if getting Apache 500 errors.
    # -----------------------------------------------------------------------------------------------
    
    <IfModule mod_php5.c>
      php_flag magic_quotes_gpc       off
      php_flag magic_quotes_sybase    off
      php_flag register_globals       off
    </IfModule>
    
    # -----------------------------------------------------------------------------------------------
    # 7. Set default directory index files
    # -----------------------------------------------------------------------------------------------
    
    DirectoryIndex index.php index.html index.htm
    
    # -----------------------------------------------------------------------------------------------
    # 8. ProcessWire requires mod_rewrite
    # -----------------------------------------------------------------------------------------------
    
    <IfModule mod_rewrite.c>
    
      RewriteEngine On
      AddDefaultCharset UTF-8
    
      # -----------------------------------------------------------------------------------------------
      # 9. If you only want to allow HTTPS, uncomment the RewriteCond and RewriteRule lines below.
      # -----------------------------------------------------------------------------------------------
      # RewriteCond %{HTTPS} off
      # RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
      
      # If using an AWS load balancer, use these two lines below instead of those above:
      # RewriteCond %{HTTP:X-Forwarded-Proto} =http 
      # RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
      # -----------------------------------------------------------------------------------------------
      # 10. Set an environment variable so the installer can detect that mod_rewrite is active.
      # Note that some web hosts don't support this. If you get a 500 error, you might try 
      # commenting out this SetEnv line below. 
      # -----------------------------------------------------------------------------------------------
    
      <IfModule mod_env.c>
        SetEnv HTTP_MOD_REWRITE On
      </IfModule>
    
      # -----------------------------------------------------------------------------------------------
      # 11. OPTIONAL: Set a rewrite base if rewrites aren't working properly on your server.
      # And if your site directory starts with a "~" you will most likely have to use this.
      # -----------------------------------------------------------------------------------------------
    
      # RewriteBase /
      # RewriteBase /pw/
      # RewriteBase /~user/
    
      # -----------------------------------------------------------------------------------------------
      # 12. Access Restrictions: Keep web users out of dirs that begin with a period,
      # but let services like Lets Encrypt use the webroot authentication method.
      # -----------------------------------------------------------------------------------------------
    
      RewriteRule "(^|/)\.(?!well-known)" - [F]
    
      # -----------------------------------------------------------------------------------------------
      # 13. OPTIONAL: Redirect users to the 'www.' version of the site (uncomment to enable).
      # For example: http://processwire.com/ would be redirected to http://www.processwire.com/
      # -----------------------------------------------------------------------------------------------
    
      # RewriteCond %{HTTP_HOST} !^www\. [NC]
      # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
      # ----------------------------------------------------------------------------------------------- 
      # 14. OPTIONAL: Send URLs with non-ASCII name-format characters to 404 page (optimization)
      # ----------------------------------------------------------------------------------------------- 
    
      # RewriteCond %{REQUEST_URI} "[^-_.a-zA-Z0-9/~]"
      # RewriteCond %{REQUEST_FILENAME} !-f
      # RewriteCond %{REQUEST_FILENAME} !-d
      # RewriteRule ^(.*)$ index.php?it=/http404/ [L,QSA]
    
      # -----------------------------------------------------------------------------------------------
      # 15. Access Restrictions: Protect ProcessWire system files
      # -----------------------------------------------------------------------------------------------
    
      # Allow screenshot files (for install.php only: this 1 line below may be removed after install)
      RewriteCond %{REQUEST_URI} !(^|/)site-[^/]+/install/[^/]+\.(jpg|jpeg|png|gif)$
      # Block access to any htaccess files
      RewriteCond %{REQUEST_URI} (^|/)\.htaccess$ [NC,OR]
      # Block access to protected assets directories
      RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/assets/(cache|logs|backups|sessions|config|install|tmp)($|/.*$) [OR]
      # Block acceess to the /site/install/ directory
      RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/install($|/.*$) [OR]
      # Block dirs in /site/assets/ dirs that start with a hyphen
      RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/assets.*/-.+/.* [OR]
      # Block access to /wire/config.php, /site/config.php, /site/config-dev.php, and /wire/index.config.php
      RewriteCond %{REQUEST_URI} (^|/)(wire|site|site-[^/]+)/(config|index\.config|config-dev)\.php$ [OR]
      # Block access to any PHP-based files in /templates-admin/
      RewriteCond %{REQUEST_URI} (^|/)(wire|site|site-[^/]+)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$ [OR]
      # Block access to any PHP or markup files in /site/templates/
      RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ [OR]
      # Block access to any PHP files in /site/assets/
      RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/assets($|/|/.*\.php)$ [OR]
      # Block access to any PHP files in core or core module directories
      RewriteCond %{REQUEST_URI} (^|/)wire/(core|modules)/.*\.(php|inc|tpl|module|info\.json)$ [OR]
      # Block access to any PHP files in /site/modules/
      RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module|info\.json)$ [OR]
      # Block access to any software identifying txt files
      RewriteCond %{REQUEST_URI} (^|/)(COPYRIGHT|INSTALL|README|htaccess)\.(txt|md|textile)$ [OR]
      # Block all http access to the default/uninstalled site-default directory
      RewriteCond %{REQUEST_URI} (^|/)site-default/
      # If any conditions above match, issue a 403 forbidden
      RewriteRule ^.*$ - [F,L]
    
      # PW-PAGENAME
      # ----------------------------------------------------------------------------------------------- 
      # 16a. Ensure that the URL follows the name-format specification required by PW
      # See also directive 16b below, you should choose and use either 16a or 16b. 
      # ----------------------------------------------------------------------------------------------- 
    
      RewriteCond %{REQUEST_URI} "^/~?[-_.a-zA-Z0-9/]*$"
      
      # ----------------------------------------------------------------------------------------------- 
      # 16b. Alternative name-format specification for UTF8 page name support.
      # If used, comment out section 16a above and uncomment the directive below. If you have updated 
      # your $config->pageNameWhitelist make the characters below consistent with that. 
      # ----------------------------------------------------------------------------------------------- 
      
      # RewriteCond %{REQUEST_URI} "^/~?[-_./a-zA-Z0-9æåäßöüđжхцчшщюяàáâèéëêěìíïîõòóôøùúûůñçčćďĺľńňŕřšťýžабвгдеёзийклмнопрстуфыэęąśłżź]*$"
      
      # END-PW-PAGENAME
      # -----------------------------------------------------------------------------------------------
      # 17. If the request is for a file or directory that physically exists on the server,
      # then don't give control to ProcessWire, and instead load the file
      # ----------------------------------------------------------------------------------------------- 
    
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !(favicon\.ico|robots\.txt)
    
      # -----------------------------------------------------------------------------------------------
      # 18. OPTIONAL: Prevent ProcessWire from attempting to serve images or anything in /site/assets/. 
      # Both of these lines are optional, but can help to reduce server load. However, they
      # are not compatible with the $config->pagefileSecure option (if enabled) and they 
      # may produce an Apache 404 rather than your regular 404. You may uncomment the two lines
      # below if you don't need to use the $config->pagefileSecure option. After uncommenting, test
      # a URL like domain.com/site/assets/files/test.jpg to make sure you are getting a 404 and not
      # your homepage. If getting your homepage, then either: do not use this option, or comment out 
      # section #2 above that makes ProcessWire the 404 handler. 
      # ----------------------------------------------------------------------------------------------- 
    
      # RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|ico)$ [NC]
      # RewriteCond %{REQUEST_FILENAME} !(^|/)site/assets/
    
      # ----------------------------------------------------------------------------------------------- 
      # 19. Pass control to ProcessWire if all the above directives allow us to this point.
      # For regular VirtualHosts (most installs)
      # ----------------------------------------------------------------------------------------------- 
      RewriteRule ^(.*)$ index.php?it=$1 [L,QSA]
    
      # ----------------------------------------------------------------------------------------------- 
      # 20. If using VirtualDocumentRoot (500 NOTE): comment out the one above and use this one instead
      # ----------------------------------------------------------------------------------------------- 
      # RewriteRule ^(.*)$ /index.php?it=$1 [L,QSA]
    
    </IfModule>
    
    #################################################################################################
    # END PROCESSWIRE HTACCESS DIRECTIVES
    #################################################################################################

     

  10. Good morning guys,

    I have a weird issue with Processwire 3.0.123. Whenever I try to edit my root page in the backend I get the "Bookmarks" section instead of the edit page view.

    (-> http://localhost/processwire/page/edit/bookmarks/)

    The link target of the root page in the backend, however is shown as: 

    http://localhost/processwire/page/edit/?id=1 

    So there seems to be some redirect happening in between. Has anyone ever faced such an issue? Any help would be appreciated, since I basically can't edit my homepage.

    //edit: I thought about removing the bookmarks module since I don't need it, which should in theory help with the problem. I wasn't able to find bookmarks as a standalone plugin that can be deactivated. Is this possible?

     

    Greetings derelektrischemoench

  11. HI guys,

    I'm using twig for my frontend and I'm trying to pass $options to the menu for rendering.

    For some reason I can't achieve what I want, as I seem unable to pass associative arrays to the render() call in twig. I'm using markupMenuBuilder to render the menu.

    I generate it as follows:   

       $menuBuilder = $modules->get('MarkupMenuBuilder');
       $options = array(
        'has_children_class' => 'has_children',
        'current_class' => 'active',
        'menu_css_id' => 'main',
        'menu_css_class' => 'nav',
    );
    
    $view->set('options', $options);
    $view->set('menuBuilder', $menuBuilder);
    
    

    to make menuBuilder accept the options I would have to pass them to the render function in php like this:

       echo $menu->render('sidenav', $options)

     

    I can't get this to work in twig since I don't get how to pass the options to the render function when using twig. Can anyone point me in the right direction plz?

     

    Best whishes deM

  12. Hi guys,

    I'm trying to resize images which I query through getRandom(). I can't seem to get it right though. What I have so far is:

     

    $randomImage = $pages->get($targetPageId)->images->getRandom()

    Which returns an image, albeit in original resolution. I assumed I should be able to call resize() on the image like so:

    $randomImage = $pages->get($targetPageId)->images->getRandom()->width(400)

    Which unfortunately gives me an exception. I assume this is because getRandom() might not return an image but something else(?).

    So how would I do this correctly?

     

    Greetings

    derelektrischemoench

     

  13. Hi Kongondo,

    thanks for the quick reply; I fixed my mistake by nesting the loops. I'm totally not used to php, which treats arrays very differently than other languages. What I ended up with was this:

     

    foreach ($menuItems as $item) {
        $targetPageId = $item['pages_id'];
        $randomImage = $pages->get($targetPageId)->images->getRandom();
        $menuItemsRendered[] = array(
            'page_id'=>$item['pages_id'],
            'title'=>$item['title'],
            'url'=>$item['url'],
            'image'=>$randomImage
        );
    }

    which works perfectly fine. Thx  for the support.

  14. Hi guys,

     

    I'm struggling a little getting a menu rendered here. After having build the menu I want to manipulate it; I want to add all menu items to an array, grab an image from each of the target pages in the menu and then render each menu item with some pictures from its target page. I tried using getMenuItems() for this but somehow it fails, I probably don't really get how to properly use it. Here's what I have so far:

    $menuBuilder = $modules->get('MarkupMenuBuilder');
    $menu = 'mainNav';
    
    $menuItems = $menuBuilder->getMenuItems($menu, 2, $options);
    $bundledMenuItems = array();
    $menuItemsWithPictures = array();
    
    //build an array that holds the random picture for each category in the menu
    
    foreach ($menuItems as $menuItem) {
        $targetPage = $pages->get($menuItem->id);
        $menuItemsWithPictures['title'] = $targetPage->title;
        $menuItemsWithPictures['pictures'] = $targetPage->get('images'); //this array is intentional, I want to do some slideshow thingy there
        array_push($bundledMenuItems, $menuItemsWithPictures);
    }
    
    $view->set('menuItems', $menuItems);
    $view->set('bundledMenuItems', $bundledMenuItems);
    
    ?>

    (This code is probably highly questionable, I'm not really proficient in php; love ProcessWire but despise php...., but what the hell.)

    I can't, however, seem to render all the items with their corresponding pictures in the frontend.

    I'm using twig as a template engine; this is what var_dump returns in the frontend:

     

                pages:
                array(4) {
      [0]=>
      array(2) {
        ["title"]=>
        string(4) "Home"
        ["pictures"]=>
        object(ProcessWire\Pageimages)#235 (2) {
          ["count"]=>
          int(1)
          ["items"]=>
          array(1) {
            ["steinlampe_2_grayscale.png"]=>
            string(26) "steinlampe_2_grayscale.png"
          }
        }
      }
      [1]=>
      array(2) {
        ["title"]=>
        string(5) "Admin"
        ["pictures"]=>
        NULL
      }
      [2]=>
      array(2) {
        ["title"]=>
        NULL
        ["pictures"]=>
        NULL
      }
      [3]=>
      array(2) {
        ["title"]=>
        string(5) "Pages"
        ["pictures"]=>
        NULL
      }
    }

    ... which aren't the pages that I declared in the menu with menuBuilder. I there something I'm missing here?

    My desired menustructure should be:

    illustrationen
    leuchten
    impressum
    ...

     

    Does anyone have an idea what I got wrong here?

    Best regards, derelektrischemoench

     

     

  15. HI guys, 

    I'm currently building a site which displays a selection of processwire pages in one frontend page. My Page tree looks something like this:

    flavors:

    • a
    • b
    • c
    • ...

    flavors is the page that gets rendered a, b, c... are child pages of this page. All of these pages contain an image field although some images are high res the other are low res. I added a checkbox field to select whether the image is high / lowres and i want to render them conditionally based on this checkbox value. I have troubles separating these pages though as I seem to be unable to query whether the high res checkbox is set. I'm using the twig template engine to render the frontend. My page selection looks something like this:

     

    $available_flavors = $pages->get(1017)->children();
    $available_flavors_high_res = $pages->get(1017)->children('is_high_res_image=1');

    In my frontend I render the values like that:

     

    <div class="row">
      {% for flavor in available_flavors_high_res %}
      <div class="col-sm d-flex flex-column">
        <div class="shishaFlavor align-self-center"
             style="background-image: url('{{ flavor.shisha_flavor_image.url }}')">
        </div>
        <h3>{{ flavor.title }}</h3>
      </div>
      {% endfor %}
    </div>
    
    <div class="row">
      {% for flavor in available_flavors_low_res %}
      <div class="col-6 col-sm-4 col-md-3 col-lg-2 d-flex flex-column">
        <div class="shishaFlavor align-self-center smallImage"
             style="background-image: url('{{ flavor.shisha_flavor_image.url }}')">
        </div>
        <h5>{{ flavor.title }}</h5>
      </div>
      {% endfor %}
    </div>

    The check whether the the high_res value is set, however gets ignored. I assume this has to do something with the way I select the child pages in the PHP snipptet above.

    Could someone point me in the right direction on how to correctly separate the images with the high-res- flag from the ones without? I guess this would boil down to correctly selecting the boolean.

    Thanks in advance, derelektrischemoench

  16. AAAAAWWW YEEEEA!. Thx... Don't know why I didn't think about that possibility myself. I only tried google cache but something was borked there.

    Anyways, thanks again and good luck getting your website stuff going ;-)

    Greetings DeM

  17. Oh yea, one other thing..... I tried rendering truncated posts on my front page, which worked fine. When I click on "Show more" on the truncated posts, I would expect the module to show me the full post and render the comments section etc.

    Well.... the rendering of the comments etc. works but the post remains truncated, though. It also outputs the "show more" link but when I click that, nothing happens. I use the "blog post" template to show individual posts, but I was unable to find a function that shows me the post in full..... 

    Back when your blog was online I remembered that there was an argument that could be passed to renderPosts; something like renderPosts(truncate=false) or something like that. I tried that but when I do so, php throws an error. What was the exact argument / the correct way to enable have a single post including comments rendered in full?

    Best wishes, DeM

  18. Phew, nice to hear that. I was beginning to worry whether the documentation would be gone forever. 

    but in that case.... This project of mine doesn't have a schedule so I'm going to wait until you've got your documentation up and running again because w/o it I'm lost.

    I'm excited to see the new stuff you've got planned, so good luck on your coding, for now :)....

    Greetings from Germany,

    DeM

  19. good evening gentlemen,

    so I have recently set up a Vagrant LAMP stack with the your Blog Module to, well, develop a blog.

    Unfortunately though, I seem to be unable to reach your website on which you so beautifully used to explain the ins and outs of the API to the module. Apparently the domain got deleted according to the notification on the site.

    So, is this a permanent state, did you stop the further development of the module or can we expect to see your site up and running again in a few days?

    I really liked the tutorials you offered there, since I don't know that much about web development and it offered a great starting point to get stuff going.

    Best wishes, 

    DeM

    • Like 1
  20. Hi Guys,

    I was wondering whether there is an option to change the language of the publishing date of each post and also the archives from English to German.

    So far though, I was unable to find a solution to this. Is this possible?

    To elaborate: I want individual posts and the archive to say :

    2015

           März

    rather than

    2015

         March

    I tried changing the locale in my header.inc but that didn't help. So is there a way to achieve this?

    Greetings from Germany

    derelektrischemoench

  21. Hi guys,

    thanks for the great tutorial, however, I get zero output. Which is unfortunate. I'm new to this whole thing and my php-skills are poor, but could this have to do something with the last line of the file, the template-include?

    // include site's main template which outputs everything
    include("./home.php"); 
    

    It would be awesome if anyone could help me with this.

    By the way, what would be my main template? I thought there was no such thing, the only thing that's consistent in my pages are the includes of the header and footer.

    /edit: I managed to do the redirect etc., after the mail is sent my code displays a success message, unfortunately though, it doesn't send a mail. I've tried several of my email adresses as recipients, it just doesn't work. Checked my spam folders as well, no luck there. 

    I'm developing locally on a WAMP stack, could this have something to do with that perhaps something about the configuration of my apache server?

    /edit2: when I inspect the output of the site I get the following line:

    <form action="./" method="post">

    Do I need to specify a designated mail option in a separate php- script? or does the one Ryan posted already do its job?

    Best regards, 

    Chris

×
×
  • Create New...