Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. I could show you things in #ProcessWire, you'd never wanted to go back and use another system.

  2. Seems like a weird menu or I don't get it. If it's for a menu, why it needs a "Select page"? I'm not sure MSN is made for that task if it's a nested menu structure cause it used UL//OL style nesting that isn't the same as a Select menu would require. I haven't tried but maybe something like this works for a single level menu. $nav = $modules->MarkupSimpleNavigation; $options = array( "outer_tpl" => "||", "list_tpl" => "||", "item_tpl" => "<option value='{url}'>{title}</option>", ); $content .= "<select id='mobile-nav'>"; $content .= "<option>Select</option>"; $content .= $nav->render($options); $content .= "<select id=''>"; There's JS plugins that can make a Select menu out of a UL list menu.
  3. Soma

    Colors and Time, :)

    Reminds me of Chromachron wehre the author tried to make colors for the hours of the day. http://www.prismo.ch/chromachron/
  4. That's seems like a viable solution, but only for the active current page. You also just set the "item_current_tpl" and that's only for the current active page. If that's the idea that's ok. MarkupSimpleNavigation doesn't change any page context at all. So the $page you have there's is only the current page viewing. When working with a hook, you would have to check for current page with if($child === wire("page")) { // do your markup logic } Taking the example from the readme I linked earlier it would be like: $nav = $modules->get("MarkupSimpleNavigation"); function myItemString(HookEvent $event){ // the current rendered child page $child = $event->arguments('page'); // if current child you're viewing if($child === wire("page")) { $myimage = $child->images->getTag('icon')->width(50); $itemMarkup = "<div class='nav-icon'><img src='{$myimage->url}'></div><a href='{$child->url}'>{$child->title}</a>"; $event->return .= $itemMarkup; // send back the markup that will present a item } } // setup the hook $nav->addHookAfter('getItemString', null, 'myItemString'); // a render will then also trigger the hook above on each item echo $nav->render(); This would allow to have all different logic in your output depending on custom criterias
  5. Hi Peter, that's what hooks are pretty much the solution to all those special cases. There's various examples in this thread, on a example gist https://gist.github.com/somatonic/6258081 And in modules readme: https://github.com/somatonic/MarkupSimpleNavigation#hook-for-custom-item-string-new-in-120 Hope that helps.
  6. How would the page action work then if horizontal?
  7. Ah sorry, it seems I haven't commited it yet or forgot it... It's now updated.
  8. We always use Fredi front end editing module where yu can make page(s) or just certain fields editable that open in a modal after saving it refreshes page. So it's the most easy and straight forward way to implement front-end editing. Or alternatively put edit links to the page edit screen ($page->editUrl) and use them plain or some modal js to open the link in a overlay (iframe) would be something that gives you freedom.
  9. If it's a single page select then you don't foreach as it's not an PageArray. It's the page object already. if($page->feat_home_ppty) { echo $page->feat_home_ppty->title; } Not sure why that comments playing a role here when doing it wrong.
  10. We're lightyears ahead.
  11. I think I found the problem a pushed a fix and it's now v 1.3.4. Good find, thanks for the mention.
  12. I think I see what is causing this but don't fully understand yet as with a new instance it shouldn't be limited by the first. A second call with no arguments it should default to "null" but looks like it's somehow saved but don't get how this happens. In my quick test It's only if you use a PageArray as root page. If using only 1 page as the root it doesn't happen. So for a quick solution you just have to explicit set the root page or items.
  13. Turn off output formatting first. As name is a string and not an object when output formatting is on. Or try $page->getUnformatted(fieldname)->getLanguageValue(lang) Or just this as it's a page native field.. $page->get("name$langId")
  14. Try this $anzeige->save(array("quiet" => true, "uncacheAll" => false)); Any page save clears some cache. I don't know but it was always like this that when you have page saves on front-end templates happening. That might interferer with some methods that are cached previously. Not sure why prev and next are affected here, could be a bug or a side effect of an optimization for these methods that have some overhead. You can also call a $pages->uncacheAll(); before your $page->next and it won't work.
  15. RT @processwire: New post: PW 2.6.14 – Sanitizer and Input now a couple. Plus new methods in Sanitizer. And much more: https://t.co/UZWCL8E…

  16. RT @processwire: New post: ProcessWire 2.6.13 core updates, plus a sneak preview of the new ProDrafts module – https://t.co/EINe2jwr5v

  17. Then your <h1><?php echo $page->title; "Holiday Cottages"; if($page->editable()) echo "<p><a href='$page->editURL'>Edit</a></p>"; ?></h1> also outputs title of cottage and edit link? It's like you overwrite $page somewhere (header.inc?) or just the template like $page->template = "something" instead of $page->template == "cottage" ... Strange, and I don't see what's wrong. Only thing I know is that you're viewing a page that template doesn't have pagination enabled.
  18. Maybe you should show us all template code... You either have a $page = $somethingElse overwriting current page. Or you render the page from another page.
  19. That means that the page you're looking at, its template doesn't have page numbers enabled. Can you change it to this? echo "template: " . $page->template->name . " pagenum: " . $page->template->allowPageNum;
  20. What do you get if you add this to your code just before foreach? echo "pagenum: " . $page->template->allowPageNum;
  21. Location template aren't the items you want to paginated aren't they? Is location template = central-lakes or ambleside ?
  22. Only thing I can say is that /adult/child/?page=2 Actually /child/?page=2 indicates that pagination is NOT enabled on the page you are on doing it, if it was it would be /child/page2
  23. What's the url when you go to page 2? Is there something else special in your setup? Otherwise I would say pagination is not enabled or you have other limit calls previously in your code.
×
×
  • Create New...