Jump to content

Zeka

Members
  • Posts

    1,065
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zeka

  1. @Macrura thanks for point me into the right direction. By using $useDone variable i was able to do what i need. I would ask you to give some example of correct using of $this->halt();
  2. @Macrura thanks for attention to my question. Im using almost the same sctructure as BlueVr profile.
  3. Hi. Im using delegate template approach and for some templates with some url segments i need to change _done.php to some another file. Is it possible via hooks or init.php? Would be appreciated for any suggestions
  4. I found out that getLanguages() method does not return data if page template does not have template file. Is it normal behavior or bug?
  5. Hi. You can try these two online tools, they both do not use blacklists https://fontie.flowyapps.com/home http://transfonter.org/
  6. 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.
  7. Hi. It was 1.7.7 Now it works without issue about blank page, but notice still present.
  8. 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
  9. 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. 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. OctoberCms Light gray background and blue hover effect Concrete5 No background, but hover effect ModX No background, but light blue hover effect Opencart, Cockpit, Joomla No background and no hover.
  10. One more addition. Background switcher should also appear on image select popup window.
  11. Agree with you. I think that also it would be nice to be able to set default background in field setttings.
  12. Hi. I have a lot of white and transparent png images and its quite difficult to find needed one: 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
  13. 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); But when i try to get languages of a pages of menu groups getLanguages() returns: $groupLanguages = $menu_group->getLanguages(); bd($groupLanguages); 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?
  14. Got the same error on PW 3.0.25
  15. 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?
  16. LostKobrakai, thanks for help! Final solution wire()->addHookBefore("ProcessPageEdit::processSaveRedirect", function(HookEvent $event) { $url = $event->arguments(0); $page = $event->object->getPage(); if($page->template->name == 'blog-entry') { if($url == "../") { $goto = wire("pages")->get(3062)->url; $event->arguments = array($goto); } } });
  17. 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.
  18. 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?
  19. Hi guys and thanks to everybody for suggestions. I should look to all of them more deeply.
  20. Hi. I need to output some custom external and internal links in admin sidebar navigation menu. Is there some predefined way to do that or i have to create process module? Thanks
  21. Hi. Thanks for useful module. I noticed that MediaLibrary.js is loading on frontend even if there is no edit functionality? Is it normal behavior?
  22. Thanks to all for very useful answers. Best community!
  23. 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?
×
×
  • Create New...