Jump to content

kongondo

PW-Moderators
  • Posts

    7,473
  • Joined

  • Last visited

  • Days Won

    144

Everything posted by kongondo

  1. Nice find Robin! @humanafterall, I've tested FieldtypeURLLanguage. It works like language fields with inputs for all available languages. It would work in your case but will obviously require input for all/required languages by your editors.
  2. Now that I think about it more, it seems that a redirect would suffice as well? I don't know zilch about redirects and SEO if that is not a problem then all we need is for the hook to redirect to the same page in the current language under certain conditions. So, thinking out loud here: We can limit the hook to certain frontend templates, a parent, etc. If condition #1 is met, we check if the current user language is not the default language. If it is, we abort. If condition #2 is met, we check if the requested page is viewable in the current user language. If yes, we redirect to its URL. If not, we do nothing. Having said that, I cannot off the top of my head remember where to hook. Maybe before some page render. I'll have a look, unless somebody else beats me to it ?.
  3. Two options: No template file for the template the children pages use (direct access to a child URL will lead to a 404). Make the children unpublished (accessing children will result in a 404 unless you are logged in and have view rights to those children). In this case, selector should have include=unpublished.
  4. @Max Allan Niklasson, Welcome to the forums. I just had a quick look but you are basically caught in an infinite loop with all those includes. You have this: In MarkupBodyBuilder.module <?php public function init() { include_once __DIR__ . "/vendor/autoload.php"; include_once __DIR__ . "/BodyBuilder.module";// <==== THIS $this->addHookAfter("Fields::save", $this, 'hookWhenFieldSaved'); $this->addHookAfter("Field::getInputfield", $this, 'hookHideTitle'); $this->addHookAfter('Page::renderField', $this, 'hookRenderField'); $this->twig = new Environment(new ArrayLoader(), [ 'autoescape' => false, 'debug' => $this->config->debug ]); $this->twig->addExtension(new DebugExtension()); return parent::init(); } In ProcessBodyBuilder.module <?php public function init() { include_once __DIR__ . "/BodyBuilder.module";// <==== THIS $process = $this->wire('process'); if ("$process" === "$this") { $this->headline($this->moduleInfo['page']['title']); } return parent::init(); } In BodyBuilder.module <?php namespace ProcessWire; use Exception; include_once "MarkupBodyBuilder.module";// <== THIS include_once "ProcessBodyBuilder.module";// <== THIS That is not how you reference other installed modules in ProcessWire; Call them like this where you need them: <?php // inside a class $bodyBuilder = $this->wire('modules')->get('BodyBuilder'); // outside a class // $bodyBuilder = $modules->get('BodyBuilder'); // outside a class but inside a function // $bodyBuilder = wire('modules')->get('BodyBuilder'); More info https://processwire.com/api/ref/module/
  5. That's very doable using ProcessWire. That's a good choice. You can post this as a job in the jobs forum.
  6. This is an interesting problem ?. I don't think it is possible out-of-the-box since having a language active does not prevent access to other languages. Hence, ProcessWire 'respects' the requested URL, as long as it is viewable. Off the top of my head I cannot remember if there is a module out there that solves this problem, but have a look, just in case, especially for modules by Robin S. Otherwise, you'll need a hook or a textformatter module that changes the links on the fly.
  7. Yes. Install MAMP (for MAC), the free version; not MAMP Pro. Welcome to ProcessWire and the forums.
  8. Thanks for reporting back and apologies for the hiccup! I have now updated Media Manager so hopefully this problem will not re-occur for future installs.
  9. Basically, you are doing something like this: <?php namespace ProcessWire; $someVariable->isLoggedin(); // BUT the value of $someVariable is a string, e.g. "some_string" // IT NEEDS to be an object of type User Hence, you get an error since a string cannot have properties or methods (functions). It would have been better to see your code ( your custom login/register system. ) but even without that, what you need to do is to check if $someVariable is an object of type User before calling isLoggedin() on it.
  10. @adrian I think I have managed to resolve the issue in my case. I was using setImportData() to create the file/image fields and my import data contained a fileSchema declaration (set at 7). Removing that entry resolved the issue. I tested on a new install, creating the field using the GUI, using the API (non setImportData() usual method) as well as using setImportData(). I was only able to reproduce the issue as I mention above. I have closed the bug report but please let us know if you are still seeing the issue. Thanks.
  11. This could be someone who probably develops PHP apps using Laravel and has probably never even used ProcessWire. I'd expect something similar from a developer whose tool of choice is WP ?. So, unless they show you some benchmarks, I wouldn't necessarily believe it. Having said that, I don't know if ProcessWire is faster than Laravel or not. About stability, ProcessWire is very stable and reliable, although I am not sure what definition of stable we are using here. This really depends on your needs. I don't understand what you mean by 'wanting to setup a directory'. Both ProcessWire and Laravel have their strengths depending on the type of application or website you want to build. Laravel is a fine piece of kit just like ProcessWire is, however, the entry levels differ as well as their out-of-the-box experiences. The fact that you went to Fiverr tells me that you want somebody else to build the 'directory' for you? In that case, ask yourself questions such as long term support: which system (community) will serve you better in this case? E.g., if your developer 'vanished', will you still be able to use the system, get the support needed? What about scalability? Are we talking hundreds, thousands, millions of records/pages? There are many other questions but rather than throw the kitchen sink at this, maybe tell us a bit more about your 'directory' ?. Just my 2p.
  12. Hi @panx, Apologies for the issue you are facing. @toni's issue was resolved by following steps similar to what you tried above. It was caused by the ProcessWire tags issue discussed here and reported here. I have now set up a troubleshooting guide (WIP) in the documentation to help with this. Please try that first and let me know if your issue is still unresolved. Thanks.
  13. Interesting. Today even saving twice didn't work for me. I had to do it about 7 times!
  14. @fruid, do you not have access to the ProFields forum?
  15. Filed an issue here: https://github.com/processwire/processwire-issues/issues/1287
  16. Hi @toni, I already responded to your query that you sent via email this morning ?. This was 7 hours ago. Maybe my email ended up in your spam/junk mail folder? Please have a look. Thanks.
  17. Yes. Please see the links to the gists found here in the documentation. For any further MB-related questions, please post in its support forum.
  18. Actually you can use MenuBuilder for very complex menus by using the getMenuItems() feature ?. You could even use Macrura's recursive function with it (adapted, of course).
  19. Quick question, why are you cloning the pages? What properties/fields of the cloned page will you want to keep and which ones will you want to edit? I suppose you might want to edit to change the title (and possibly name) of the cloned item. The reason I am asking is that IMO, for your specific use case, I don't think the ProcessPageClone GUI/form is very user friendly (?). Won't questions/information about a new page being created/cloned be confusing to your editors? Secondly, how do you intend to reload the page after the clone is finished? I am thinking maybe that a minimal custom form with say, only an input for the title for the incoming/new page table item should suffice? You would then process the form via ajax, close the modal and append details of the newly created item to the PageTable table without reloading the page. You would obviously need an endpoint to process the form, clone the page and create a new Page Table item. Just some thoughts. I don't know the whole context so my ideas may not be feasible ?.
  20. I now get you, fully. What you need is to add the page to the page table field. You need to add it like you would an item to a PageArray or WireArray. Something like this: <?php namespace ProcessWire; $pageWithPageTableField = $pages->get(1055); // page with the page table field you're adding the new (cloned) item to // $clonedPageTableItem = $pages->get(1059); // can add as ID as well $clonedPageTableItemID = 1059; $pageWithPageTableField->of(false); //$pageWithPageTableField->your_page_table_field_name->add($clonedPageTableItem); // @note: here you can first check if this page table field already has this item and skip in that case, just to be sure $pageWithPageTableField->your_page_table_field_name->add($clonedPageTableItemID); $pageWithPageTableField->save('your_page_table_field_name'); You will need to hook somewhere and this has to be after your page has been cloned. Maybe try hooking AFTER pages:cloned? You will need access to the IDs 1055 (page with the PageTable field) and 1059 (cloned page for used as PageTable item) in my example.
  21. Hi all, To those who have asked questions, just noting here that I have seen them and will answer you when I get a bit of time. I will respond by editing the first post, whenever possible, just so we have Q&As in one easy-to-find location. Thanks.
  22. @Orkun, I have looked at the ProcessPageClone code and it should clone to the correct parent of PageTable Items. Did you try it? Looking at this code (where the page is cloned) found here: <?php namespace ProcessWire; $clone = $this->pages->clone($page, $page->parent, $cloneTree); You can see ProcessWire will preserve the parent of the page being cloned. Since you are cloning a PageTable item (which is a page), ProcessWire knows and will keep its parent (i.e., in your example, the parent page of PageTable items, with the ID 2133).
×
×
  • Create New...