Jump to content

ro-bo

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by ro-bo

  1. Someone has an idea? In the meantime i solved it with this code: $out = count($page->fieldname) == 1 ? $page->fieldname->title : ''; Is this the right strategy? Robert
  2. Hello, I started a new project, where I have some Options Fields to select some different values. I'm using multi-language support and the input type is Select (Single Value). Processwire v 2.6.1. When I'm editing the page and choose some values everything is all right! But when I set the value back to blank, suddenly strange things happens: If I'm checking the selected value via API I always get the ID of the first and the last option-item separate by a pipe: eg. 1|4 if there are 4 options or 1|2 if there are 2 options available/selectable So I take a look in the DB and realized that there are always 2 entries for the same page_id with the first and the last data-ID of the selectable options. Is it a bug or a feature? For my client sometimes it's necessary to choose a blank option, for me it's important to check this by API. So how can I realize this with the Select Options Fieldtype? Does anyone have an idea to get this working? Thanks for your help, Robert
  3. @totoff thanks, but what i am looking for is, that only pages of level 3 (in the site tree) should appear the in the sub_menu whether pages from Level 2 (main_menu) or Level 3 (sub_menu) are selected...
  4. Hi totoff, thanks for your reply. I have already tried this, but there is a problem when level 3 is activated (page on level 3 is the current level) -> level 3 is not displayed! $root = $page->children('template=xyz_template'); $sub_nav = $nav->render($sub_nav_options,null,$root); I have found a (quick-and-dirty) solution by myself: // Nav-Level 3; switch (count($page->parents)) { case 2: $root = $page; break; case 3: $root = $page->parent; break; default: $root = false; }//end switch $sub_nav = $root ? $nav->render($sub_nav_options,null,$root) : false; ..... .... But maybe anyone know a better solutions for this. Thanks! Robert
  5. Hallo, does anyone know how to realize a navigation with MarkupSimpleNavigation that starts eg. at level 3? I don't know how to set the starting point for a lower level... (First Navigation) -Home -Level1 --Level2 --Level2 -Level1 --Level2 --Level2 -Level1 --Level2 ...... I'm looking for something like this (Second Navigation): ---Level 3 ---Level 3 ---Level 3 ..... addition: The third Level (Level 3) is dependant on the second Level (Level2)... Thanks for your help!
×
×
  • Create New...