Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


fruid last won the day on November 5 2020

fruid had the most liked content!

Recent Profile Visitors

1,186 profile views

fruid's Achievements

Sr. Member

Sr. Member (5/6)



  1. I'm in the process of removing a module (SnipWire) and all dependencies, templates, fields and pages. Now there's an admin page in the trash which I cannot delete I get: PagesTrash: Page /trash/1029.2.2_snipwire/custom-cart-fields/ (1030) cannot be deleted: it has “system” and/or “systemID” status What to do?
  2. OK thanks again. Anyways, I was looking into other modules that seem to use a different approach. Instead of relying on an admin-template with fields or constructing custom fields, they just create plain sql tables in the database via mysql commands (e.g. module ProcessPageViewStat). It would then render a form or whatever in the admin area to display the data in that database table. Is that good practice? What are the dangers? To be honest, I also struggle with creating custom fields which would go a long way for me in order to create custom modules. I'd like to construct custom fields, possibly also include custom javascript or components of some framework/library (vue.js, jquery, …) I remember having seen a dummy/boilerplate-module that illustrates and walks you through the process of creating a custom field, just cannot remember the name… thanks for help
  3. @Jan Romero thanks, what you're saying makes good sense. Creating pages instead of repeater items for each post input seems a good solution, provided that those pages can be admin only. However, for this particular use case, I prefer to have all user submissions on one page, just would make things much easier for my intentions. So I would need to create a template for that new admin page which includes a repeater field or ProFieldsTable field (I have been using that), right? Do I do that in the templates section of the admin area ("add new template") or programatically? It seems to me like those admin pages and templates are created differently… I think that's what I struggle with mostly. Also, creating a custom fieldtype is something I would love to be able to do, just couldn't wrap my mind around it yet.
  4. is there a way to store the user input (post) in some custom admin page? I don't need a new page for each submission, just one page, not visible to the user, only to me in admin with a list/table of all user submitted data.
  5. yes that's the one. I had the issue before a long time ago. still recovering from racking my brain back then
  6. I'm doing if ($config->ajax) { echo "THIS IS AJAX"; $this->halt(); } else { echo '<div id="content">'; echo 'THIS IS MY REGULAR CONTENT'; … echo '</div>'; } and I use $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; $config->useMarkupRegions = true; $config->useFunctionsAPI = true; in the config.php However, the site stills loads the entire page in the ajax response, which is not what I want of course, I get the header and menu etc where I render the response (result.innerHTML = response); suggestions?
  7. I'm trying to understand the basics of module development in PW. I'm quite confused with the structure of it. what I put figured out so far… the object class "Process" is going to be applied as a "process" to the admin page and attach to the top menu of the admin panel. The function __execute is what puts content on this page. Here's my first question: How can I add input fields for content to be added to the database? then you have the module itself that will appear in the modules tab (and page tree under admin but hidden). There I can add input fields via the class ModuleConfig and the function __construct am I right? but also, you can navigate to the modules section, overview of all site and core modules (and uninstalled ones and new ones) where you can see another "settings" button which doesn't appear on the module's detail page. (a bit weird, isn't it?) anyways, long story short, I'm quite confused about the different classes and which one I should actually use when building a module and how to know. I might add that I'm not a php expert, though I have built a bunch of websites with some rather complex templates in PW already, I still haven't touched any of this stuff. Maybe it's still some of my lack of understanding of php (also need to learn about the difference of implements and extends for example) but I feel that these PW classes are somewhat arbitrary. So is there a way to get more clarity on that?
  8. Hello all, I'm familiar with HannaCode and use it on some projects already. Now I wonder what it actually is good for to apply it as a text formatter on a template field. Here's what I'm trying to accomplish and where I thought it would be a good solution to use custom code for. For a shop "module" (not yet a PW module, but some php and javascript files) I'm working on, I need a way to allow for stacked prices, say a different unit price when buying 10 units. So since these unit prices and stack price rules would differ from product to product, I thought a very simple, fast and flexible solution would be to allow for custom code injection. So for example the content manager could write: if($itemAmount=10){$unitPrice=30}else{$unitPrice=35}; Does that make sense? So long story short, I need custom code on specific pages. Is that possible with the HannaCode Text formatter?
  9. only removes the first opening double quotes, the second closing double quotes stay 😂
  10. also… if ($page->isChanged('seo_title') || $page->isChanged('seo_image') || $page->isChanged('seo_description')) return; is there a nicer way to do this?
  11. I'm trying to add hook before the page is saved. Then it should check if the SEO fields are empty and if so, use page's field's values that make sense. let me illustrate: $wire->addHookBefore('Pages::saveReady', function($event) { $page = $event->arguments[0]; if (!$page->id) return; if ($page->isChanged('seo')) return; if ($page->seo->title == '') { if ($page->template == 'speaker') { $page->seo->title = $page->academicrank.' '.$page->givenname.' '.$page->lastname; $page->message(':D'); // just to make sure the conditions are set right :D } else { $page->seo->title = $page->title; } } $event->arguments(0, $page); }); Something like this. I do get the message : D, so the issue is not there. However, the seo title field stays empty. Any ideas why this is not working?
  12. is there a $sanitizer method that can remove quotes? I need to remove them for SEO.
  13. also, sharing via facebook is not embedding the image. It seems to work fine with twitter and linkedin but not facebook. I'm using the module MarkupSEO to declare the social media image. When simply sharing the page-url on social media platforms manually, it seems to work fine, so that module doesn't seem to be the problem. However, I added <meta property="og:image:url" content="<?php echo 'http://'.$_SERVER['HTTP_HOST'].$page->poster->url; ?>" /> (as suggested further up) in case that's required for fb because the MarkupSEO-module doesn't provide that tag. Doesn't help though. And then also, I do not quite understand what the following means ?u={url}&title={title}&text={text}&media={media} these are placeholders? what goes in here for real? Lastly, I should mention that on the page itself, the image is not displayed, i.e. not included in the <body>, because it would be redundant with an embedded iframe on the page, so we left it out. Don't know if that's the issue. Thanks for help!
  14. nice module. Could you also make it possible to just copy the current url? What I mean is add another button that when clicked copies the current url to the clipboard. I'm trying to accomplish that with the current options of the module but no luck. Maybe if I could hook the function before rendering there would be a chance…
  • Create New...