Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. I think you're missing the inputfield init() to set the properties // fieldtype and inputfield config settings $this->set('parent_id', 0); $this->set('template_id', 0); // placeholder only $this->set('columns', ''); $this->set('nameFormat', '');
  2. Here's an example module that removes "Add New" button(s) on InputfieldPageTable on a condition (here if there's 2 ore more entries). Hook before InputfieldPageTable::render, then add hook after InputfieldButton::render. Since InputfieldButton is used by PageTable, we just use that hook to empty the returned markup for the button. Then remove that button hook after the InputfieldPageTable rendered. https://gist.github.com/somatonic/c9db5c43f10d050bb14d
  3. The title and body should work also for childpages. Not sure what you mean. DO you have now each child page create under the subsite /about/? And you use a page field reference to select the mainsite under /about/? That would be ok to create dummy pages and do that, and your code should work. But can't really help to find the problem as I'm not in front of it. Also mademyday made some valid points over here https://processwire.com/talk/topic/1025-multisite/?p=71136 Somehow it is be possible to display content from the main site and use url segments and output the fields on the subsite. If you don't understand how to get this going, may we can provide example code to get you a start. It's just hard to follow for me ATM. Just create only the About page on the subsite. And use a template on which you enable url segments under its url configuration screen. It has no children. The main site in root has About page with children. Code to test for url segment and get page from main site. On the About page of subsite. // if needed, don't allow more than 1 url segment and show 404 if(count($input->urlSegments) > 1) throw new Wire404Exception(); // when 1 url segment found like /about/childpagename/ if(count($input->urlSegments) == 1) { $childname = $sanitizer->pageName($input->urlSegment1); $original = $pages->get("/about/$childname/"); // try get the original page if(!$original->id) throw new Wire404Exception(); // not a page // if we got this far we're on a child page, so render content from it // but were still on the /subsite/about/ echo "<h1>$original->title</h1>"; echo $original->body; ... } else { // we're on /about/ subsite, so maybe just show a list // of the original children from main site with url and a segment foreach($pages->get("/about/")->children as $child) { echo "<h3>$child->title</h3>"; echo "<p>$child->summary</p>"; echo "<a href='$page->url{$child->name}'>view more</a>"; // now construct url using child page name // if page name of main site is also /about/, you can even just use $child->url. // as that will already be the correct url we need here echo "<a href='$child->url'>view more</a>"; } } Edit: Just an example, had rewritten some.
  4. Ah right just setting $page to another page when rendering the content in a template would work I guess for that page yes, but that's all. It's not "the" other page in other places maybe like navigation etc, in other modules or PW system, it's just in your template at that time. It depends a lot where you and how you do this. Of course for children of that page it won't work just so. I think mademyday already mentioned other approaches that maybe work, with url segments etc. Edit: I don't think it's all that easy and what pitfalls and drawbacks this all would have, and don't know what all the factors are that you need to render pages from another site. Usually what I think is the approach to just juggle with $page objects leads to unexpected results and should be avoided, more so if you don't know what you're (or PW) doing.
  5. This is not really possible. It will render the page as it would be on your main site like navigation links etc. Also this is not possible like this: $page = $page->includePage; This will only replace the variable $page with the other page object, but only autoloaded fields like "title". But ID and other fields etc won't. If then, this would be more like it: wire()->fuel->set("page", $page->includePage); But then $page will be the other page with all it's properties, which may or may not come in your way.
  6. It was originally in 2.4, then 2.5 and now 2.6
  7. What I'm really missing and waiting in PW since the beginning are draft/live versions of pages, basicly more advanced workflow/publishing options. I feel this would be a lot more needed than all the new features we got. Not saying they're bad. I hope we get that with 2.5!
  8. RT @processwire: Language Translation Updates– PW now finds translatable files for you + creates language pack ZIPs automatically: https://…

  9. Maybe does the example site help that comes with it https://github.com/jdart/Spex/blob/master/example-site/_init.php#L30 The path for the file is relative to /templates/... but you got the absolute path. And you need something like this line to output the styles: here using AIOM (AllInOneMinify) module https://github.com/jdart/Spex/blob/master/example-site/layouts/_base.php#L16
  10. I just tested this and I can confirm this happens like you describe.. though that could be intended (but can't say) in it that you just remove the "what" to view filter, but the dynamicrole is still there saying that user "testuser" can "view" pages... But the fact that you delete and create a new dynamicrole with no "What to view" filter set, the basic-page pages aren't viewable anymore, unlike the other case. So definately something spooky going on here. However you better open an issue on github on the module repository as it is more likely to be seen there by Ryan: https://github.com/ryancramerdesign/DynamicRoles/issues and refer your post.
  11. public function ready(){ if(wire("page")->template == "admin") return; wire("page")->template = "ajax"; } done. Not sure about consequences. Page viewable is set by if template exists or not.
  12. You can also just use the inspector to change color in css live on the page. Chrome, FF etc I like this for example #559AAC
  13. Or this are nice tool for colors. http://www.dasplankton.de/ContrastA/ https://kuler.adobe.com/de/create/color-wheel/ http://colourco.de/ (Just was trying to find an color palette tool I used year or two ago.)
  14. Try something like http://snook.ca/technical/colour_contrast/colour.html I don't have an issue on my imac pro retina.
  15. That's your servers security settings doing this, not PW.
  16. SiteProfiles can't be installed like this Read the install part here http://modules.processwire.com/modules/process-wire-bootstrap3/
  17. $province = $pages->get("name=provincename"); But usually you have the select option value the ID since name isn't unique.
  18. Something like this can be done Top root menu // default root is "/" echo $treeMenu->render(array("max_levels" => 1)); Submenu $root = $page->rootParent; // top root parent of current page echo $treeMenu->render(array("max_levels" => 1), null, $root);
  19. ProcessWIre urls are "/path/" not "/path"
  20. In other browsers drag and drop works on the input button to add files ( without ajax ), if that works in IE it's almost like the html5. Haven't tested on IE9. A polyfill? https://github.com/Jahdrien/FileReader caugh.. dependencies, I don't know...
  21. ufff, just thinking... would a onchange on the file input with triggering the save button help as workaround? Maybe bombined with a add hash to form action url to jump to image field? Kinda hacky but should work fine. $('#ProcessPageEdit #Inputfield_images').on("change", function(e){ $("#ProcessPageEdit").attr("action", $("#ProcessPageEdit").attr("action") + "#Inputfield_images"); $("#submit_save").trigger("click"); });
  22. You do a GET and then you catch POST?
  23. What if you have multiple image fields on page? Or a image field with only max 1 image? And also one field with slider and field without?
  24. I think it would be rather $products = $pages->find("template=product, (product_name=computer), (product_category=electronics)");
  25. Or groups are in dev since couple months and then 2.5. https://processwire.com/talk/topic/3768-processwire-dev-branch/?p=64049
×
×
  • Create New...