Jump to content

lokomotivan

Members
  • Posts

    56
  • Joined

  • Last visited

Everything posted by lokomotivan

  1. Try this: <?php $get_field = $fields->get('some_field_name'); $field_options = $get_field->type->getOptions($get_field); foreach($field_options as $option) { // }
  2. +1 on SamC suggestion, laragon is great! Im also using vagrant and https://box.scotch.io/ now. full ubuntu enviroment out of the box, in combination with https://github.com/deveres/vagrant-manager-windows
  3. <?php echo $pages->get('/shopping-cart')->url ?> your request not hitting the page, you need: <?php echo $pages->get('/shopping-cart/')->url ?> or to make sure u always get the right page even if you change name: <?php echo $pages->get('template=your_shopping_cart_template')->url ?> And dont forget in your shoppping-cart template to check for ajax request: <?php if($config->ajax) { // page was requested from ajax }
  4. Ive done something simular recently, well not sure if this is what u looking for: Simple markup (number in a class represents opacity level) <div class="tm-overlay-dark-60"> <img src="" /> </div> If u want to use it with background image, just need to define height <div class="tm-overlay-dark-60" style="height:500px;background:url(./myimage.jpg) center center no-repeat;backgroudn-size:cover;"> </div> I usually use uikit framework and less @tm-overlay-dark-bg: #000; @tm-overlay-light-bg: #fff; /** * TM Overlay BG */ [class*='tm-overlay-'] { position:relative; } [class*='tm-overlay-']:before { content: ""; display:block; position: absolute; top:0; bottom:0; left:0; right:0; background: fade(@tm-overlay-dark-bg, 60%); z-index:0; } /** * Dark */ [class*='tm-overlay-10']:before, [class*='tm-overlay-dark-10']:before { background: fade(@tm-overlay-dark-bg, 10%); } [class*='tm-overlay-20']:before, [class*='tm-overlay-dark-20']:before { background: fade(@tm-overlay-dark-bg, 20%); } [class*='tm-overlay-30']:before, [class*='tm-overlay-dark-30']:before { background: fade(@tm-overlay-dark-bg, 30%); } [class*='tm-overlay-40']:before, [class*='tm-overlay-dark-40']:before { background: fade(@tm-overlay-dark-bg, 40%); } [class*='tm-overlay-50']:before, [class*='tm-overlay-dark-50']:before { background: fade(@tm-overlay-dark-bg, 50%); } [class*='tm-overlay-60']:before, [class*='tm-overlay-dark-60']:before { background: fade(@tm-overlay-dark-bg, 60%); } [class*='tm-overlay-70']:before, [class*='tm-overlay-dark-70']:before { background: fade(@tm-overlay-dark-bg, 70%); } [class*='tm-overlay-80']:before, [class*='tm-overlay-dark-80']:before { background: fade(@tm-overlay-dark-bg, 80%); } [class*='tm-overlay-90']:before, [class*='tm-overlay-dark-90']:before { background: fade(@tm-overlay-dark-bg, 90%); } /** * Light */ [class*='tm-overlay-light-10']:before { background: fade(@tm-overlay-light-bg, 10%); } [class*='tm-overlay-light-20']:before { background: fade(@tm-overlay-light-bg, 20%); } [class*='tm-overlay-light-30']:before { background: fade(@tm-overlay-light-bg, 30%); } [class*='tm-overlay-light-40']:before { background: fade(@tm-overlay-light-bg, 40%); } [class*='tm-overlay-light-50']:before { background: fade(@tm-overlay-light-bg, 50%); } [class*='tm-overlay-light-60']:before { background: fade(@tm-overlay-light-bg, 60%); } [class*='tm-overlay-light-70']:before { background: fade(@tm-overlay-light-bg, 70%); } [class*='tm-overlay-light-80']:before { background: fade(@tm-overlay-light-bg, 80%); } [class*='tm-overlay-light-90']:before { background: fade(@tm-overlay-light-bg, 90%); } Maybe u need to change :before z-index if you dont use image as background image
  5. https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
  6. I think you just have to remove the parent=1018 from your selector, doctor page cant be child page of multiple locations... $doctors = $pages->find('template=staff-page,locations=$page'); foreach($doctors as $doc) { echo "<h4>$doc->title</h4>"; }
  7. Just installed it, first thing i noticed that it doesn't work with custom hanna tags, works with "[[", but not with custom one "{{" i currently use for hanna codes
  8. This seem exactly what i need at this moment, especially for hanna :), will try it out definitely, thank you!
  9. You need to echo image html and use image field as a src attribute. Processwire doesn't add any html to the front-end, 0, but it provides you everything you need. In this case, lets say you have image field on a page: <?php $page->image // will get you jsut image name my_image.jpg $page->image->url // will get you image path site/assets/files/1234/my_image.jpg ?> <!-- and here full image --> <img src="<?= $page->image->url ?>" />
  10. Not sure if this can help, but this is how i handle csv inport/export with pw: https://gist.github.com/lokomotivan/331aff00152b7cf2ac9b6605576e1e23
  11. How's jquery blocked in some browsers by default? Anyways, you can achieve this with just css, something like this (well this is way over simplified): <ul class="my-menu"> <li><a>item 1</a></li> <li><a>item 2</a></li> <li> <a>item 3</a> <ul class="submenu"> <li>submenu item</li> <li>submenu item</li> </ul> </li> <li><a>item 4</a></li> </ul> <style> .my-menu > li:nth-child(3) > .submenu { width:100%; } </style>
  12. Would be much easier to use html themes them wp ones. You can't avoid copy/paste html chunks, and there is many little things to handle like active classes on menus etc... very simple to do with pw, but requires some work and time. Processwire not adding any code to the front-end, so u have to build it ur self, thats one of the reasons pw is so great. It doesn't have any template system like drumlapress.
  13. Also, there is a nice monospace font with ligatures support you can use, its supported in atom, vscode, brackets etc. You guys might like it: https://github.com/tonsky/FiraCode
  14. I use dose mentioned packages only, haven't used or tested any other, they work fine for me, but im sure there are some more jquery related packages you can try. VSCode is great to, its faster, but for me copy-pasting chunks of code works lot better in atom (vscode somehow always mess up ident tab spaces). There are lots of plugins for it to choose from, but can't recommend any specific, haven't tried them...
  15. I use atom https://atom.io/ and some packages like: https://atom.io/packages/jQuery https://atom.io/packages/jquery-snippets
  16. Maybe u can take a look at snipcart. Edit: lol i just realised its post from 2013 . Anyways if someone looking for simular, snipcart is still relevant
  17. Not sure how do you wanna display results. If u want to group them by the template, u can simply have two search results and loop true them separately: $matches1 = $pages->find("title~=$q, template=speech-archive-detail"); $matches2 = $pages->find("title~=$q, template=training-detail"); Or, if you wanna mix the results, u can check for the template in a loop: <?php if ($count) : ?> <?php foreach ($matches as $result) : ?> <?php if($result->template == "speach-archive-detail"):?> <!-- Display results this way --> <?php else: ?> <!-- its not speach-archive-detail, display it in a nother way --> <?php endif;?> <?php endforeach; ?> <?php endif; ?>
  18. Yep, they are right, sorry about that echo "<ul class='uk-nav uk-nav-default'>"; foreach($categories->children() as $cat) { echo "<li><a href='$cat->url'>". $cat->title . $pages->find("categories=$cat")->count . "</li>"; } echo "</ul>";
  19. Not sure what do you mean by "Selector field type", do you mean page reference field? A little more info would be nice, what are you trying to do with the reapeater
  20. if u wanna use ukNav() function, u would need to edit it to display count. I dont know how your categories and post are structured, but based on ur post, this can maybe help: $categories = $pages->get('/categories/'); echo "<ul class='uk-nav uk-nav-default'>"; foreach($categories->children() as $cat) { echo "<li><a href='$cat->url'>{$cat->title} {$pages->find('categories=$cat')->count}</a></li>"; } echo "</ul>";
  21. In processwire, there is a "page-edit-created" permission so you can easily restrict any user to be able to edit only page created by them. And you have multiple ways to achieve how users will manage pages. 1. You can allow users to create/publish/edit pages via the backend. Ofc, they will have access only to stuff u allow via permissions (module, admin, trash and system only superuser). 2. Make a front-end form to submit pages via API, and use some (free) module for editing, like: http://modules.processwire.com/modules/front-end-edit-lightbox/ 3. Use form-builder premium module to create pages, and for editing some module like one above 4. You can do everything via api on front-end, creating and editing pages. So final answer is yes, you can make contributive site with processwire, many ways to do it in pw.
  22. Some ideas about the design https://www.google.rs/search?q=pagekit&biw=1920&bih=950&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiR_ZC3xMLSAhVCSZoKHUKZAGEQ_AUIBigB PageKit looks nice, and ofc its using uikit for backend
  23. Got the point :). Often forget, and get carried away by design. Anyways, i like the term "admin theme framework", thats exacly what we need.
  24. And some people like to discuss about taste, so they can find something in common
  25. And regarding cards, i think they can be nice, but used as fieldset container rather then per field, and maybe only in nested fieldsets.
×
×
  • Create New...