Jump to content

Nicolas

Members
  • Posts

    99
  • Joined

  • Last visited

  • Days Won

    1

Nicolas last won the day on September 16 2013

Nicolas had the most liked content!

Contact Methods

  • Website URL
    https://www.omnitic.com

Profile Information

  • Gender
    Male
  • Location
    Nantes, France

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Nicolas's Achievements

Full Member

Full Member (4/6)

113

Reputation

1

Community Answers

  1. Hi, You may find a soltution to your problem here : Hope this helps.
  2. You need to iterate over the menu items object. <?php $mainMenuItems = $mb->getMenuItems('Main navigation', 2, $options); foreach($mainMenuItems as $menu_item) { // You know have access to $menu_item->title // You know have access to $menu_item->url // See the doc for available $menu_item properties $has_children = ''; $has_children_dropdown = ''; $dropdown = ''; $tag_class = $menu_item->cssClass!=''?$menu_item->cssClass . ' ' . $has_children:$has_children; if($menu_item->isParent) { $has_children = 'has-submenu'; $has_children_dropdown = '<span uk-icon="chevron-down"></span>'; $children = $wire_pages->get($menu_item->pagesID)->children(); $dropdown = '<div uk-dropdown="animation: uk-animation-slide-top-small; duration: 300; animate-out: true; offset: 0; pos: bottom-left"><ul class="uk-nav uk-navbar-dropdown-nav">'; foreach($children as $child) { $dropdown .= '<li><a href="' . $child->url .'">'. $child->title . '</a></li>'; } $dropdown .= '</ul></div>'; } if($menu_item->pagesID == $current_page->parent->id || $menu_item->pagesID == $current_page->id) { $item = '<li class="current-item ' . $tag_class . '"><a href="' . $menu_item->url .'">'. $menu_item->title . $has_children_dropdown . '</a>' . $dropdown . '</li>'; } else { $item = '<li class="'. $tag_class .'"><a href="' . $menu_item->url .'">'. $menu_item->title . $has_children_dropdown . '</a>' . $dropdown . '</li>'; } if($menu_item->parentID == 0) { echo $item; } }
  3. @virtualgadjo I might compare ProcessWire to the Perl language : "There is more than one way to do it" ©. Thanks to ProcessWire flexibility, it's good to have options depending on the way one is more comfortable with.
  4. Hi, Using ProcessWire notice system you could do something like <?php // In /site/ready.php $wire->addHookAfter('ProcessPageEdit::execute', function (HookEvent $event) { $pageEdit = $event->object; $page = $pageEdit->getPage(); if ($page->template == 'home') { $this->wire('notices')->add(new NoticeMessage("Hello World")); } });
  5. Great feedback. Regarding the second point of the things you don't like, ProcessWire provides core functions to manage the urls as you wish. Either with URL Hooks or with the templates' URL segments settings you can easily opt out the tree hierarchy structure of the pages. Thanks for your modules contributions.
  6. “Gentlemen you had my curiosity ... but now you have my attention.” ― Quentin Tarantino, Django Unchained
  7. Hi @wbmnfktrThanks for your answer. I'm indeed using the TemplateEngineLatte module, but I think my issue is more related to the point mentionned by @BillH regarding the "sort=sort" parameter nested pages. I ended up adopting a recursive approach to solve my problem as shown below : <?php // In init.php $catalogue_root = $pages->get(1027); $view->categories = getOrderedCategories($catalogue_root->id); function getOrderedCategories($current_category_id, &$categories = []) { $current_categories = wire()->pages->get($current_category_id)->children('template=category'); foreach($current_categories as $category) { $categories[] = $category; // populate the reponse with category page object getOrderedCategories($category->id, $categories); // proceed with sub categories } return $categories; }
  8. Hi, I need to make a filter sidebar for a catalogue displayed in a tree like fashion. To get the list of the catalogue root page i've the the following $view->top_categories = $pages->get(1027)->descendants('template=category, sort=sort'); In the category template the children a sorted by 'None'. What would be the right selector to display the tree like filter with the categories sorted in the same order as the pages in the admin section ?
  9. Fixed ! Thank for the heads-up.
  10. We just launched 2 new project in the past sooner this week. The first one is Overline Systems. The following modules were used : AdminStyleRock, Formbuilder, ProCache and the MarkupMenuBuilder. The second is a simple one page : De la Cave au Cellier
  11. Hello Webjack, Great writeup on ProcessWire from a beginner point of view. A quick note : in the breadcrumb ProcessWire is spelled wrongly. It should be ProcessWire whithout a dash (-). Glad to see you're enjoying ProcesWire while dicovering it and learning english at the same time. Merry Christmas !!
  12. You can test multiple conditions in PHP if a if instruction as shown below if( $page->id == 1042 || $page->id == 1043 ) { // Do something here }
  13. Welcome on board Webjack !! Bienvenue dans la communauté ProcessWire. De mon expérience, ProcessWire est en effet un CMS orienté développeur. Pour cette cible c'est un outil très agréable et efficace grâce notamment à son API. Comme indiqué sur la page d'accueil, il est simple à utilisé pour les clients. Pour les créateurs de site il est indispensable d'avoir un minimum de connaissance de PHP. Cela dit entre la documentation qui est très bien faite et le support de la communauté sur le forum, on peut rapidement progresser. As far as you can imagine ?
  14. HI @bernhard, this is an awesome addition to the ProcessWire eco system ! Great job ? I've noticed a little hiccup on this page : https://www.baumrock.com/en/processwire/modules/rockpagebuilder/ in the FAQ section. Clicking on the second question opens the response of the first one.
  15. Hi, I wanted to give Wireframe a shot with the Latte renderer but can't get it to work. The layouts/default.latte template does'nt seem to load the views/home/default.latte I'm using the ProcessWire 3.0.228 with PHP 8.2. and both Wireframe and WireframeRendererLatte have been installed via ProcessWire (not with Composer). What am i doing wrong ?
×
×
  • Create New...