Jump to content

totoff

Members
  • Posts

    495
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by totoff

  1. HI Soma and cstevensjr,

    thanks again for your replies. Logging out, clearing etc. doesn't make a difference. I'm afraid this

    But what I experienced also from reports that in Chrome sometimes really strange things happens, like showing a completely wrong image on a cached page, somtimes even a icon from Chrome itself!

    is the best answer as I've played around with it for another while and found the trouble to start when I switch to mobile simulation in Dev Tools while on normal desktop size everything is fine ... So presumably this is indeed a Chrome based problem.

  2. Hi all,

    I've done some further testing and the problem has definitely got to do with PW's template caching: the cache should be disabled because I'm logged in as superuser but isn't.

    Is there a way to disable template caching via the api during development? Or, as an alternative, how can I save all pages at once via the api? (maybe $page->save() with a foreach?)

    Thanks

  3. Hi all,

    I'm developing a responsive Website with the following setup:

    • PW 2.5.3
    • Debug = true
    • Template caching set to one month, guests only
    • Google Chrome latest release (not the beta channel)

    With this setup I'm experiencing weird problems when using Chrome dev tools:

    • changes in my templates are not reflected in the frontend until the page is saved (despite caching is set to "guests only")
    • after each page save I'm logged out from the admin and have to log in again

    I can repeat this problem since days and on Windows as well as on OS X. In contrast, if I switch to Firefox Developer Edition's dev tools everything works as it should - no problems at all. So presumably it's some interference with Chrome's dev tools.

    Does anybody has experienced the same? Any hints for debugging?

    Thanks!

  4. Hi Robert,

    $root = $page->children('template=xyz_template');
    

    This defines the children of the current page as root page (presumably level 2 in your site tree if I understood you right). So the pages on level 2 and 3 (in the site tree) should show up in the menu if you have the following options defined:

    'show_root' => true,
    'max_levels' => 2, 

     If they nevertheless don't render I would first of all check if

    $root = $page->children('template=xyz_template');
    

    returns an empty array.

  5. Hi all,

    finally I just released a major update to my Unsemantic Site Profile. Here are the most important features:

    • runs on Processwire 2.5.3
    • delegate template approach
    • includes Superfish dropdown menu (requires markup simple navigation module)
    • preconfigured Google Maps implementation
    • includes simple accordion textformatter Module

    The profile is meant as a starting point for RWD on Processwire. Glad if you find it useful. You can see a preview here.

    Question: Does somebody know how to update the entry in the modules directory?

    EDIT: comments, suggestions etc. welcome

    • Like 6
  6. Hi Nico,

    if($page->numChildren) $session->redirect($page->children->first->url);
    

    works. But I would still like to understand why

    $content2 = $pages->get(1015)->children("sort=-sort");
    

    renders child 2 as child 1 while

    $content2 = $pages->get(1015)->children("sort=sort");
    

    renders the correct order. I mean, there is something wrong obviously ...

    $pages->get(1015)->children->first
    

    is not applicable as 1015 is just one out of many sections sharing the same problem.

  7. I don't know exactly, but does sort=sort not sort by the order of pages are in the pagetree?

    Yes, you are right, it does. I was wrong.

    Also there shouldn't be a problem if children() returns the right order as child() internally calls children()

    I tried

    $content2 = $pages->get(1015)->children->first;
    

    and it returns /child 1/ (id 1023). However, the problem remains

    if($page->numChildren) $session->redirect($page->child()->url);
    

    still redirects to /child 2/ (id 1024) ...

  8. Hi LostKobrakai,

    thanks for your post.

    $page->children without selector echoes the correct order.

    $content2 = $pages->get(1015)->children("sort=-sort");
    

    returns /child 2/ as the last item in the list (that is, the oldest page). However, /child 1/ is definitely older as per its created timestamp ...

    EDIT: corrected confusion of younger/older

  9. Hello all,

    I was absent for a while from developing - seems I got rusty in the meantime ... Having weird trouble with trying to redirect a page to its first child. I have the following structure:

    - /section/ (template A)

    -- /child 1/ (template B)

    -- /child 2/ (template B)

    and so on.

    Template A has the following conditional:

    if($page->numChildren) $session->redirect($page->child()->url);
    

    However, whenever /section/ is clicked, it redirects to /child 2/ but not to /child 1/. This happens on every section with template A and children.

    To make this even more weird, the redirect has worked perfectly fine for weeks and the strange behavior occurred today after editing content in the admin.

    Template A sort settings == none

    /section/ page sort settings == nothing selected

    I've tried selector "sort=sort" but it changes nothing (/child 1/ is the oldest page). I've also tried to set child sort order on /section/ to manual-drag-and-drop. Again without success.

    I'm quite helpless with this and would appreciate any help. Thanks.

  10. <nav class="top-bar" data-topbar>
        <section class="top-bar-section">
          <ul class="right">
            <li class="divider"></li>
              <?php $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module
              $options = array(
              'has_children_class' => 'has-dropdown'
              );
              echo $treeMenu->render($options); // render default menu ?>
            </li>
          </ul>
        </section>
    </nav>
    

    The pattern is very easy. The above example will attach the class "has-dropdown" to every list item that has a submenu. Try to understand the Readme by comparing it to my example and you will understand quickly.

    Edit: Misspelling corrected

    • Like 3
  11. And, as you were mentioning it, there is no such thing like "accurate colours" in webdesign. Your best bet is to purchase a monitor with neutral colour balance, sharpness and good viewing angle. The overall quality matters. And that's it. If you would like to make print work that's a different beast. Than accuracy matters a lot.

    • Like 3
×
×
  • Create New...