Jump to content

anyway

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by anyway

  1. Hi, I'm trying to exclude a field on a certain page in the backend using the "field dendencies", but I don't succeed. I need something like this: Show this field only if the page ID is NOT 1001 Variants of this do not work: page_id!=1001 Thanks!
  2. Thanks a lot for the hints, Soma! Everything works now as expected. I misunderstood the concept of' show_root' => true,
  3. Hi, I have a tree with 3 sublevels and I'm trying to build a sidebar navigation that shows the children when there are children and the siblings when there are no children. The code below doesn't seem to work for me.... the output is alway the complete tree, on every page. <?php //sideBarMenuNav change items to view if($page->hasChildren) { //we are on a first level parent page so show sencond level $entries = $page->children; } else { //we are on second level so show siblings to actual page $entries = $page->siblings; }; $sideBarMenu = $modules->get("MarkupSimpleNavigation"); $options = array( 'current_class' => 'current-menu-item', 'has_children_class' => 'has_children', 'max_levels' => 2, 'collapsed' => false, 'show_root' => true, 'outer_tpl' => '<ul class="menu vertical sidebar_menu">||</ul>', 'inner_tpl' => '<ul class="menu vertical nested">||</ul>', 'item_tpl' => '<a href="{url}">{title}</a>', 'item_current_tpl' => '<a href="{url}">{title}</a>', ); echo $sideBarMenu->render($options, null, $entries ); It is the approach of mr-fan, from here: What's wrong with my code? The contents of the variable "entries" are correct, for each page level. Thanks!
  4. Thank you bernhard! You're right, it's a general problem related to touch and non-touch devices and with javascript you can prevent clicking on the "real" link. However, I am still confused about the page structure. Don't I need a page in the tree to provide the trigger link and then another one for the first link in the dropdown, which would actually be one and the same? I don't know how to explain this differently than by the two trees I have shown above. What I'm trying to figure out is: Do I need the parent page twice in the tree, which is probably a bit of nonsense, or can the menu be built that the parent link appears twice - once as a trigger and once as a link in the drop-down list. I'm sorry if I express myself in a complicated way and ... my PHP skills are somewhere between beginner and intermediate level
  5. I have now spent a few hours doing some research in the forum, but I can't get any further with a fundamental question. What is the best practice in Processwire with regard to trigger links for dropdowns, as can be found for example in mobile navigation. With desktop navigation, I can use a link as a hover for triggering the drop-down, as well as a click that leads to the linked page. The question is, if this is good in a view of usability, because it doesn't work with a mobile drilldown navigation and some users don't realize that you can also click the trigger link. The tap always triggers the submenu. The question arises if it is not better to place the parent link always at the top of the drop-down list, too. This would then work in both desktop and mobile navigation. What would the best practice solution in Processwire be? Is there a way to place the parent link at the top of the drop-down list? I had already asked this question in the MarkupSimpleNavigation module area, but I didn't get an answer there. Maybe this cannot be realized with this module? And which page structure would make the most sense for this? Should the parent page be hidden for the trigger? It probably wouldn't be so nice. Wouldn't it be best if all pages in the page tree containing content? So my question is two-part: Which page structure is necessary for navigation where the parent is in the dropdown and how do you build such a navigation? There are certainly already robust concepts for this. It's probably just a matter of my understanding. I'm currently building a page tree, what partly schematically looks like this: |-- Link +-- Parent |-- Child |-- Child +-- Parent |-- Child |-- Child +-- Parent |-- Child |-- Child Is it possible to repeat the triggering link of the drop-downs (which should not link to the parent page) inside the dropdowns, where it links to the corresponding page of course? |-- Link +-- Parent (Trigger) |-- Parent |-- Child |-- Child +-- Parent (Trigger) |-- Parent |-- Child |-- Child +-- Parent (Trigger) |-- Parent |-- Child |-- Child Thanks for your advice!
  6. Hi guys, I'm currently building a dropdown navigation to map the page tree, what schematically looks like this: |-- Link +-- Parent |-- Child |-- Child +-- Parent |-- Child |-- Child +-- Parent |-- Child |-- Child Is it possible to repeat the triggering link of the drop-downs (which should not link to the parent page) inside the dropdowns? The parent link for each submenu should appear again at the top of each submenu. |-- Link +-- Parent (Trigger) |-- Parent |-- Child |-- Child +-- Parent (Trigger) |-- Parent |-- Child |-- Child +-- Parent (Trigger) |-- Parent |-- Child |-- Child It would be great if this could be solved with MarkupSimpleNavigation? Thank you!
  7. You're right, it looks like a javascript error, but the console does not show any errors. After the click, the elements appear to open (the three dots disappear), but the accordions doesn't drop down.
  8. @gmclelland Thanks for your reply! Yes, the user's role has the page-edit permission. In the meantime, I've been able to "solve" the problem by giving page-view access to the system template "admin" to the user role Page-View, which is probably not optimal. @Robin S Unfortunately, your code doesn't work for me. The repeater elements can no longer be opened. There is only a short twitch when you click on the elements. Any idea? ProcessWire 3.0.62
  9. I have completely uninstalled and reinstalled the module, now. I also emptied the module cache. The error still exists. I'm greatly appreciated for any hint.
  10. Strange thing: If I give the user the same rights as the superuser, the error will still persist! There is also a second error: ProcessWire: The requested process does not exist
  11. Hi, I'm using the module "AssistedURL Field" inside a repeater. It works fine when I'm logged in as superuser. When I'm logged in with restricted rights (user account), I get this error when I click the button to select a URL: Modules: Error initializing module: ProcessPageEditLink - You don't have access to this page The error appears within the appearing modal window of "AssistedURL Field" in which the URL or page can be selected. What am I missing?
  12. Hey, that worked! The page is now displayed and all error messages are gone. 1,000 karma points for you, dragan, you saved my weekend!
  13. Thanks for your superfast reply dragan! FTP upload should be complete. I have repeated the upload 4-5 times. How can I explicitly refresh the module cache? Thanks for the codesnippet!
  14. Hi, I try to move a page from my local machine to a server and get some error messages. I have uploaded the system several times and had no luck, so far. File and folder permissions are fine. I also deleted the cache files in site/assets/caches. The first error was this: Warning: your server locale is undefined and may cause issues. Please add this to /site/config.php file (adjust “en_US.UTF-8” as needed): setlocale(LC_ALL,'en_US.UTF-8'); I don't understand why, the server should be located in Germany und it is not a multilanguage website. So I copied this into the config.php setlocale(LC_ALL, "en_US.utf8") The next error message is this one: Field: Fieldtype 'FieldtypeAssistedURL' does not exist And what's really strange is that the system doesn't show the modules in site/modules! The site modules area (backend) is empty, although there should be 8 modules inside the folder. What could be the reason for all this? I have to finish the Website before Christmas and I'm just a little lost. I hope there's another one of you on the computers. Thanks a lot in advance! Here are the error.txt entries: 2017-12-23 18:02:57 admin http://my-website Fehler: Uncaught Error: Call to a member function render() on null in /webspace/00/00000/my-websitesite/templates/inc/nav-mobile.php:22 Stack trace: #0 /webspace/00/00000/my-websitesite/assets/cache/FileCompiler/site/templates/_head.php(41): include() #1 /webspace/00/00000/my-websitesite/assets/cache/FileCompiler/site/templates/home.php(1): include('/webspace/04/85...') #2 /webspace/00/00000/my-websitewire/core/TemplateFile.php(268): require('/webspace/04/85...') #3 /webspace/00/00000/my-websitewire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #4 /webspace/00/00000/my-websitewire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___render', Array) #5 /webspace/00/00000/my-websitewire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #6 /webspace/00/00000/my-websitewire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #7 /webspa (Zeile 22 in /webspace/00/00000/my-websitesite/templates/inc/nav-mobile.php)
  15. Hi Nico, thanks a lot for the lightspeed fast reply! What you recommend is working pretty fine! Thank you!
  16. Hi, at first, thanks a lot for this useful module! I'm trying to figure out, how I can set the title for the homepage by hand, while using {title} - {sitename} automatically for all other pages. {title} - {sitename} automatically for all other pages is working fine, but the homepage shows always "Home | " before the sitename. Even though I have entered (under the homepage SEO tab) the title that I want, manually. I prefer the sitename only for the homepage. I am sure that this can be easily solved somehow, but I don't get it :-/ Thanks for help!
  17. It is working very well now! Thank you so much for your help and your patience! I'll send you a PM.
  18. No problem, I'm learning a lot with this process. Few things are still mixed up a bit. So, the grid-container12 div is empty and the li's are not really inside the grid-column3 divs, or only in one of them...
  19. Thanks for the hint, diego! It is something like that, isn't it? $root = $pages->get(1); $pa = $root->children; $pa = $pa->prepend($root); echo renderChildrenOf($pa); Now, the li's are there, but the hierarchy is wrong. I'm getting only "home" and 3rd-level items. I've tried around with ->parents and so on, without success, but it feels pretty close...
  20. Ah okay, I understand and have completed it. Thank you, Pauline! Now there is an output, but only the outer html: <ul class="mega-menu"></ul> The inner part ($output) is missing. What am I doing wrong?
  21. Wow, thank you so much for your effort, Macrura! This looks interesting, very logical and clean. But there must be something wrong. The function does no output... no error, just no output.
  22. The menu can use the normal tree, which is looking like that: |-- Level 1 +-- Level 1 | | | +-- Level 2 | |-- Level 3 | |-- Level 3 | |-- Level 3 | | +-- Level 2 | +-- Level 2 | +-- Level 2 | |-- Level 1 |-- Level 1 |-- Level 1 |-- Level 1 All Level 2 items are empty pages and unclickable from somewhere. They are only for holding and ornanizing the 3rd level pages. The headlines inside the HTML are the titles of the level 2 pages and not clickable. Just plain text. My main problem is that I have too little php knowledge yet. I'm coming from the Wordpress world and did the most things with plugins, so far. Stupid, I know, but I want to change that now. So I have studied this posting from you with great interest, but only understood half, unfortunately ;-) https://processwire.com/talk/topic/2787-custom-menu-not-related-to-page-tree/
  23. Hi Macrura, thanks for your quick reply! My problem is not about the HTML/CSS, in which I am good enough. It's about the implementation with PHP and Processwire. Sorry that I have not communicated that clearly enough.
×
×
  • Create New...