Jump to content

nfil

Members
  • Posts

    138
  • Joined

  • Last visited

Everything posted by nfil

  1. Thanks again for the update Soma!! This also worked to enable the parent's page link on the menu. // load MarkupSimpleNavigation module $nav = $modules->get("MarkupSimpleNavigation"); /* SETUP HOOKs ------------- */ // hook to have custom items markup $nav->addHookAfter('getTagsString', null, 'customNavItems'); function customNavItems(HookEvent $event){ $itempage = $event->arguments('page'); // first level items with parent page url if($itempage->numChildren(true) && count($itempage->parents) < 2 && !$itempage->id=1){ $title = $itempage->get("title|name"); $event->return = '<a href="#" data-toggle="dropdown">' . $title . ' <b class="caret"></b></a>'; } // submenus don't need class and data attribs if($itempage->numChildren(true) && count($itempage->parents) > 1){ $event->return = '<a href="#">' . $itempage->get("title|name") . '</a>'; } } /* // first level items parent page with # if($itempage->numChildren(true) && count($itempage->parents) < 2){ $title = $itempage->get("title|name"); $event->return = '<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $title . ' <b class="caret"></b></a>'; } // submenus don't need class and data attribs if($itempage->numChildren(true) && count($itempage->parents) > 1){ $event->return = '<a href="#">' . $itempage->get("title|name") . '</a>'; } } */ // hook to add custom class to li's that have submenu $nav->addHookAfter('getListClass', null, 'customListClass'); function customListClass(HookEvent $event){ $itempage = $event->arguments('page'); // if current list item has children and is level 2 from root if($itempage->numChildren(true) && count($itempage->parents) > 1){ $event->return = ' dropdown-submenu'; // adds class to li } }
  2. I voted this and other contests for PW! Months ago, before I found processWire I would cast my vote on MODx which I think is still good yet ProcessWire simple API approach encouraged me to learn a bit more PHP.
  3. answered before 2014 I manage to do it a couple days ago. I'll test your solution too and give some feedback later. Thanks again for all the help Soma!
  4. Thanks Soma for this example : https://gist.github.com/somatonic/6258081 Testing it on a multi language site with a bootstrap 3 menu, how can I hide the <b class="caret"></b> in the homepage link and make it href link work just for that parent? Note: I have another parent that will open the dropdown children's menu. After Soma's hooks setup to render the $navMarkup I have: $navMarkup = $nav->render( array( 'levels' => true, 'show_root' => true, 'selector'=>"limit=6, start=0", 'max_levels' => 4, 'current_class' => 'active', 'has_children_class' => 'dropdown', 'outer_tpl' => '<ul class="nav navbar-nav">||</ul>', 'inner_tpl' => '<ul class="dropdown-menu">||</ul>', ) ); Another thing, having this as a menu structure: homepage -about -services -service one -service two If I select the service one or two links in the services parent page, the children's class is "active" can I set the parent to "active" too? thank you
  5. Diogo the logic makes sense. Only used the dot on the same line of the variable but the function is correct there is a populated $out before those. That was a very nice tutorial on php syntax for beginners like me. Thanks for de detailed explanation of the logic. Still wonder what should be the best option for this: will have a look here! http://processwire.com/api/selectors/inputfield-dependencies/
  6. thanks! Had some syntax error when I changed the function, now I have this: $out .= "\n\t\t<td>"; if($product->sc_price_drop) { $out .= '<del>' . $product->sc_price . " €</del><br/>"; $out .= number_format($product->sc_price_drop) . " €"; } else { $out .= ($product->sc_price ? number_format($product->sc_price) . " €" : $na) . "</td>"; } $out .= "\n\t\t<td>" . ($product->sc_sku ? $product->sc_sku : $na) . "</td>"; It works fine don't know if I should use the variable out with a dot before the equal sign (newbie question). I made other site with different roles but in that case I had a template to lock pages to unregistered users, this case is different. This time what would be the best way to output a field value only to a group of users with a role named retailer? Create a field named sc_price_retailer on the page with the other price values and the new sc_price_retailer field, then when a user logs in with a retailer account they can view the only sc_price_retailer field value. Would that be possible?
  7. Hello Macrura. Modified this from the skyscrapers profile to render the field for the current price (old value): $out .= ($product->sc_price ? number_format($product->sc_price) . " €" : $na); Then I created a new field sc_price_drop on a product template with a new price, how do I output the new price and show the old price blotted out? Found this post that should relate to what I want to achieve, Diogo's and Nik's examples would be a way to replace a value with a new one, using selectors? http://processwire.com/talk/topic/4860-selector-match-that-mixes-multiple-fields/?hl=replace#entry47228 thanks.
  8. Hello, I have some doubts about what should be the best way to replace and output a value, replacing another one. So I have two fields on a page, one with the old value and another with a new one, need to keep a old value in the backend and render the new one in the frontend and the old value would be blotted out. Thank you for your help.
  9. That was one of the reasons it wasn't working. I was testing it before and removed a re-arranged files, folders, It's working now. Will also follow Ryan's advice and test two prior versions and keep the latest on a temp-wire folder. Thank you horst!
  10. Installed 2.3.5 and using the multi-site : OPTION #1: MULTIPLE SITES WITH MULTIPLE DATABASES had the same settings with 2.3.0, same sever PHP and MySql versions but 2.3.5 version opens the index.html on the server's root not the index.php on the site-mydomain.com Not sure if anyone tried this or if I'am doing something wrong. I Will do some more tests to see if I have something wrong on the index-config.php or .htaccess files.
  11. I'am starting a new project next month and I will buy FormBuilder for that one. Also Installed 2.3.5 ProcessWire-dev.zip two days ago and congratulations on a great update, to you and all the forums' members testing it. I hope I can contribute to test the dev version too, here: http://processwire.com/talk/topic/3768-processwire-231-dev-branch/ Great detailed explanation and great tip too, Thanks Ryan!! : Sorry for being a little off topic. Thanks again.
  12. Thanks for the reminder. So we can start developing a production site on dev 2.3.5 and when 2.4 stable version is released, we can upgrade it. Just had doubts on a website that will need the http://store.di.net/collections/software/products/processwire-form-builder Can we use the module ProcessWire Form Builder now on dev 2.3.5 and it will work when we upgrade to 2.4 stable? Thank you.
  13. Hello. I don't know if this could this be added on the Page Name module's settings to PW installation: ã õ I added those two because I use portuguese to generate FURLS and I noticed that on PW 2.3 . Don't know if this is relevant or not. Thank you. ä=a ã=a õ=o ö=o ...
  14. Thank you seddass! I was looking for this. On the modules Page Name Settings I added a few latin characters for PW 2.3 auto generated URLS I was creating a page with the title: sopa de cação and the generated URL was sopa-de-cac-o These are the pt-pt characters I added to the module's Page Name: ã=a õ=o Not sure if PW installation could come with these two ã õ already? Just for reference: // Latin'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'AE', 'Ç' => 'C', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I', 'Ð' => 'D', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ő' => 'O', 'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ű' => 'U', 'Ý' => 'Y', 'Þ' => 'TH', 'ß' => 'ss', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'ae', 'ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ð' => 'd', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ő' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ü' => 'u', 'ű' => 'u', 'ý' => 'y', 'þ' => 'th', 'ÿ' => 'y', // Latin symbols '©' => '©',
  15. The PW forum is great! I learned a lot but still have a long way to go to contribute more. At least I hope the other members can learn from some of my newbie mistakes. Congrats to all the PW community and a big thanks for sharing their knowledge.
  16. Hi! I was looking for some answer to render a carousel, but this one is a bit different from what I've done before. update: Solved. <div class="featured_service_block"> <ul class="featured_service_slider"> <?php $services = $pages->find("template=service, featured_service=1, sort=random"); foreach ($services as $service) { ?> <li><a href="<?php echo $service->url ?>"><img src="<?php echo $service->intro_image->size(600, 450)->url ?>" alt="" title="<?php echo $intro_image->description ?>" /></a></li> <?php } ?> </ul> </div> <script> // Slider script for the "featured services" slideshow $('.featured_service_slider').bxSlider({ captions: true, pager: false, }); </script>
  17. I was quite happy with it already. Now we can fine tune the rendered menu even more than before. Probably I will update the module on my first site. Damn it Soma, why do you have to be such an hard working clever developer Thanks for sharing your knowledge and congrats on a great module/update.
  18. yes I agree, I was just curious! Your module really speeds up the process when we want to create a custom navigation. Congratulations for a great module and for all your help.
  19. Thanks Soma! I missed that detail. By the way when you limit the amount with: 'selector'=>"limit=9", It will also limit the navigation items on the submenu. Can markupSimpleNavigation set one limit for the parent menu and other for the child's menu? Thank you again.
  20. Hi! I'am just curious if any of you experienced any issue with the markupSimpleNavigation module when used with the pagination. Probably is just something wrong with my code. I'am still learning how processWire works. I have this for the menu: <?php echo "<nav id='navigation' class='navigation clearfix'><div class='menu'>"; $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module $options = array( 'has_children_class' => '', 'levels' => true, 'selector'=>"limit=9", 'levels_prefix' => 'display: none;', 'max_levels' => 2, 'outer_tpl' => ' <ul>||</ul>', 'inner_tpl' => '<ul>||</ul>', 'list_tpl' => '<li>||</li>', 'item_tpl' => '<a href="{url}">{title}</a>', 'item_current_tpl' => '<li class="current-menu-item"><a href="{url}">{title}</a></li>'); echo $treeMenu->render($options); echo "</div></nav>"; Then I have this to output some images and paginate the contents: <section id="portfolio-items"> <?php $thumbWidth = 0; $thumbHeight = 140; $imagesPerPage = 18; $start = ($input->pageNum - 1) * $imagesPerPage; $total = count($page->images); $images = $page->images->slice($start, $imagesPerPage); $a = new PageArray(); foreach($images as $unused) $a->add(new Page()); $a->setTotal($total); $a->setLimit($imagesPerPage); $a->setStart($start); foreach($images as $image) { $thumb = $image->size($thumbWidth, $thumbHeight); ?> <article class="four columns"> <a class="bwWrapper single-image plus-icon" href="<?= $image->url ?>" rel="folio" title="<?= $image->description ?>"> <img src="<?= $thumb->url ?>" height="<?= $thumb->height ?>" alt="<?= $thumb->description ?>" > </a> <a class="project-meta" href="<?= $page->url ?>"> <h6 class="title"><?= $image->description ?></h6> </a> </article> <? } ?> <div class="clear"></div> <div class="divider-solid"></div> <?= $a->renderPager(array( 'nextItemLabel' => "Próx", 'previousItemLabel' => "Anter", 'listMarkup' => "<div class='pagination'><ul>{out}</ul></div>", 'currentItemClass' => "page active", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'>{out}</a>" )); ?> </section> when I load the first page everything works but the weird thing is that when I go to the second content's page the simpleMarkupNavigation menu disappears. I've looked at the generated HTML and its not there. Did this happened to any of you?
  21. Yes I agree thats a good route to control every taylor fit elements of the website have like a site lab. For a experimental site with misuse of technologies I think the navigation and usability are pretty good. The links for the seo, with did some stuff with deep links and changing the browser title with flash sites some years ago and Google was ~happy with that, clients wanted lots of stuff jumping around and for animation, 4 or 5 years ago flash was one of the best tools to run animations, apart from heavy ones CPU/intensive and the plugin mandatory/proprietary/adobe download. So like you explained you used the best tools to accomplish the task, in the right or or not, well its a experimental site, I would still use flash as a projector/exe if a client asked me to do a presentation full of stuff jumping around. Also I really like these guys' work, they are really good with js and they don't even use deep links on their website http://www.doubleyou.com
  22. I had an inodes limit on LAMP server, the hosting company blocked the cpanel file manager and limited my ssh access, no compress files etc, I used ssh to remove all the cache/temp files by type and folder, it was a nightmare to backup and move the contents to another server. This happened due to clients uploading/changing lots of contents before the sites went live, modX revo cache folder and a two shops cache had more than 60k inodes, Now I'am really careful if the client wants a very content dynamic site, I host those on a reseller acount or a VPS server where I customise the limitations and its easier to backup. On Process Wire, I also use the module mentioned above, http://modules.processwire.com/modules/page-clean-empty-dirs/ and from a PW noob point of view does the job quite well.
  23. Congratulations on a great/unusual website UI, looks really good and navigation is still intuitive. I like the second paragraph too. My two cents: on the top of the site, I would try to decrease the paragraphs line-height or on the #main-intro class css do a simple closed accordion or reduce the padding-top, If the user has a small height resolution device, it will have to scroll down every time he visits the website to see the updated and mostly the archived postcards. Parabéns, Lisboa é linda.
  24. Everyday I'm amazed by the PW member's support. Its amazing! I was over-complicating. So after nik's great post that I missed I added the to the module 'FieldtypePage', // add this line http://processwire.com/talk/topic/383-module-import-pages-from-csv-file/page-4#entry21476 Now I have the numbers of the roles I want to import separated by pipes, and it works great, never thought it would be so straightforward: "title","pass","email","roles","headline","member_district" "261","userspassword","afcob@net.com","99|3899","AGÊNCIA","Lisboa" I only read renobird's post, have framed the posts so I don't forget to read carefully next time https://www.dropbox.com/s/xyalrrel6pw2mp1/frame.jpg And it works great! Thanks again SiNNUT
  25. Sorry to go back to this again, just to be sure on this. I imported another database, this time I tried to insert the roles field. Although renobird mentioned a way to import roles I tried that but it didn't work. No problems importing the other fields, but the roles field is missing. https://www.dropbox.com/s/btteytow6w2hpwx/last-screen.png My csv. "title","pass","email","roles","headline","member_district" "261","userspassword","afcob@net.com","associado","AGÊNCIA","Lisboa" On the roles column I have the name, maybe I need to insert a number associated with that checkbox, also I don't want to mess with the system fields yet (cause I'm a noob) but probably I have to change something in the roles field checkbox single to be compatible with the module. https://www.dropbox.com/s/mzkggp7hvacu7to/roles-field.png
×
×
  • Create New...