Jump to content

Zeka

Members
  • Posts

    1,065
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Zeka

  1. Hi @adrian
    I am sorry that i was not clear enough.

    For now i found out the answer to my question about changing active menu item. I'll describe it below so it will become more clear what I meant.
    I am using Admin Custom Pages for list some selection of pages. 

    Under "Admin" page i created these pages: 

    - Project ( This one plays role of separator and for it i choose "ProcessAdminCustomPages" as process, but leave blank selector of template. Not best solution, is there more right way? )

    -- Entries ( Admin Custom Page / name: entries ) 

    --- Edit  ( ProcessPageEdit / Hidden Page / name: edit )

    In template for "Entries" i use this code for links to edit page: 

    $config->urls->admin."section/entries/edit/?id=".$page->id,
    So when i edit any page that listed on "Entries" page "Entries" menu item in sidebar menu marked as active/current.

    But now i have to modify breadcrumb to suit current page tree.

     

  2. Hi.

    Thanks for module.

    After upgrading to 2.3.9 on PW 3.0.25 when debugger enabled for backend i get blank page on every page submit / save, even when i try to refresh modules.

     

    Also admin login and 'site.dev/admin' - blank.

    Got notice 

    PHP Notice: A session had already been started - ignoring session_start() in ...\TracyDebugger\tracy-legacy\src\Tracy\Bar.php:59

    Any suggestions? 

    Zeka

    • Like 1
  3. As another variant it can be a slider the same as zoom slider. I dont think that it would make redundant cognitive load beacouse ther look almost the same.

    ver2.jpg

    Recently I often run into such a problem. With Matrix filed it is much easier to implement lending builder etc. and there users use a lot of png icons. 

    Also I made small research how other cms deals with it.

    CraftCms

    It does not have any switchers or so, but checkerboard  background of png images is a little bit darker. 

    Screenshot_8.jpg

    OctoberCms

    Light gray background and blue hover effectScreenshot_9.jpg

    Concrete5

    No background, but hover effect

    Screenshot_13.jpg

    ModX

    No background, but light blue hover effect

    Screenshot_12.jpg

    Opencart, Cockpit, Joomla 

    No background and no hover.

     

    Screenshot_11.jpg

    Screenshot_10.jpg

    Screenshot_14.jpg

    • Like 3
  4. 54 minutes ago, szabesz said:

    @Zeka Simple and good idea!

    However, we should not leave the checkerboard option out. Better yet, probably all shade versions should still be checkerboards, a dark one, mid range and a light one. We should still signal that these are transparent images.

    BTW, this thread should be moved to https://processwire.com/talk/forum/5-wishlist-roadmap/ I suppose.

    Agree with you. I think that also it would be nice to be able to set default background in field setttings.

    • Like 1
  5. Hi.

    I have a lot of white and transparent png images and its quite difficult to find needed one:

    Screenshot_5.jpg

    For now I can use Admin Custom Files module to change background of some div, but it not so elegant solution. 

    Maybe there is some other workaround about this issue? 

    Ideally it would be nice to have some kind of background switcher near the grid swithcer

    Screenshot_1.jpg

    • Like 4
  6. Hi PWers.

    Im builing some kind of menu system for my current multilanguage project. 

    $menu - is main menus page

    $menu->menu_groups - is PageTable field that hold menus groups

    $menu->menu_groups->menu_items - is repeater field that hold menu items

    Here is the code of it:

    <div class="sidebar-right">
        <nav class="sidebar-nav">
            <ul class="sidebar-nav__groups">
                <?php
                    $currentLang = $user->language;
                    $currentPageId = $page->id;
    
                    foreach ($menus->menu_groups as $menu_group) {
                        $groupLanguages = $menu_group->getLanguages();
                        bd($groupLanguages);
                        if ($menu_group->menu_group_position == 2 ) {
                            echo "<li class='sidebar-nav__group-title'>". $menu_group->title ."</li>";
                            echo "<ul class='sidebar-nav__list'>";
                            foreach ($menu_group->menu_items as $menu_item) {
                                $out = "";
                                // If user enter custom link
                                if ($menu_item->menu_item_custom_link) {
                                    $out .= "<li class='sidebar-nav__list-item'>";
                                    $out .= "<a class='sidebar-nav__list-item-link' target='_blank' href='". $menu_item->menu_item_custom_link ."'>";
                                    $out .= $menu_item->menu_item_title;
                                    $out .= "</a>";
                                    $out .= "</li>";
                                } else {
                                    // Get list of active languages for this page
                                    if ($menu_item->menu_item_page) {
                                        $pageLanguages = $menu_item->menu_item_page->getLanguages();
                                        bd($pageLanguages);
                                        $children = $menu_item->menu_item_page->children();
                                        $isChild = $children->has($page);
                                        $active_item = ($currentPageId == $menu_item->menu_item_page->id || $isChild ? "sidebar-nav__list-item--active" : "");
                                        $active_link = ($currentPageId == $menu_item->menu_item_page->id || $isChild ? "sidebar-nav__list-item-link--active" : "");
                                        // Menu item markup if current language is active for current page
                                        if ($pageLanguages->has($currentLang)) {
                                            $out .= "<li class='sidebar-nav__list-item ". $active_item ."'>";
                                            $out .= "<a class='sidebar-nav__list-item-link ". $active_link ."' href='". $menu_item->menu_item_page->url ."'>";
                                            $out .= $menu_item->menu_item_title;
                                            $out .= "</a>";
                                            $out .= "</li>";
                                        }
                                    }
                                }
                                echo $out;
                            }
                            echo "</ul>";
                        }
                    }
                ?>
            </ul>
        </nav>
    </div>

    Im using Tracy Debuger module, so i will show outputs of it.

    When i get languages of a page of menu item, getLanguages returns expected data 

    $pageLanguages = $menu_item->menu_item_page->getLanguages();
    bd($pageLanguages);

    Screenshot_4.jpg

    But when i try to get languages of a pages of menu groups getLanguages() returns:

    $groupLanguages = $menu_group->getLanguages();
    bd($groupLanguages);

    Screenshot_3.jpg

    Also i had tried to get languages by this code: 

    $groupId = $menu_group->id;
    bd($pages->get($groupId)->getLanguages());

    But got the same result.

    All languages are active on all pages.

    PW 3.0.25

    Am i doing something wrong or missing something? 

    • Like 1
  7. On 20.06.2016 at 5:36 PM, diogo said:

    Hey @teppo, just tried the module on 2.8 and i get the error Argument 1 passed to VersionControl::isEnabledTemplate() must be an instance of Template on line 897, you have any idea of why that might be?

    Got the same error on PW 3.0.25

  8. While editing any page in admin panel "Page tree" menu item is marked as active/current.
    I need to change active menu item for some of page types.
    I was trying to change parent by hooking after render, but Im not sure that i doing things right because i quite new to all these things about hooks.
    $page->addHookAfter("render", function(HookEvent $event) {
        $parent = wire("pages")->get(3062);
        $event->object->setParent($parent);
    });
    
    

    But i got exception:

    Exception: Parent changes are disallowed on this page 
    

    Is there another way to implement it? I would appreciate any suggestions?

  9. You're not hooking anything related to those buttons. This one would even execute if anything on the frontend would save a blog-entry. I'd suggest taking a look at the hooks provided by ProcessPageEdit.

    Hi, LostKobrakai and thanks for point me in the right direction.

    Now i use this code.

    wire()->addHookBefore("ProcessPageEdit::processSaveRedirect", function(HookEvent $event) {
        $url = $event->arguments(0);
        if($url == "../") {
            $goto = wire("pages")->get(3062)->url;
            $event->arguments = array($goto);
        }
    });
    

    But i need to check if current page have template of blog entry. 

    How i can get current template name? In event data it is admin template.

  10. Hi.

    Since PW 3.0.9 we have new save actions.

    I need to change redirect url for "Save + Exit" action.

    I use this code and it works great, but it works both for "Save" and "Save + Exit" buttons.

    $pages->addHookAfter('saved', function($event) {
      $page = $event->object;
      $page = $event->arguments(0);
      if($page->template == 'blog-entry') {
          $goto = wire("pages")->get(3062)->url;
          wire("session")->redirect($goto);
      }
    });
    

    Is there way to hook only save + exit action? 

  11. Hi.

    I switched to PW from Seblod.

    In seblod we have field called "Field group". This field just group some fields to logical group.

    I think it's quite useful feature. For example: in almost all templates i have fields for SEO like title, description, index etc. ( seven fields ). In current PW workflow ( as i know ) i have to go to every field and set needed templates for it or go to every template and set needed fields. It's quite sadly :(  :(  If we could to have some sort of group field it became easily. Just put one field to every template.

    Maybe i miss something and this field is already in PW? 

    • Like 2
×
×
  • Create New...