Jump to content

jploch

Members
  • Posts

    293
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by jploch

  1. @MarkE It's a little complicated to explain 🙂
    I Am working on a pagebuilder module, that makes it possible to visualy compose a page.

    The page structure is defined by the items you add to your page. PageGrid creates a hidden page for every item that gets added to it (similar to how PageTable or Repeater Matrix work). Each item (a page) is based on a block template. A template can have multiple fields to hold your data (native ProcessWire templates and fields). 

    Each item has an edit link that opens that page in an overlay, some fields also have inline edit capacity. Now I want to be able to have my own permissions beside page-edit to control if the edit link of that item is visible or not to certain users. The page-edit permission would enable inline editing (or editing in general) und my new permission would display the edit link. Hope that makes sense.

    I think this could also be achived with multiple roles, so if use has role "edit-items" and the page-edit permission for that item template it will display the edit link. But I was just curoius if I could create those template permissions myself.

  2. this module is still a great time saver. Today I tried to use the feature to automatically load the script. But it's not working, even if I have the markup with the data-srcset rendered on the page. It's working if I load it manually. 

  3. 1 minute ago, bernhard said:

    I forgot to ask: How many mails will be sent? Tens? Hundreds? Thousands?

    Most likely less than 100 per day. There will propably have to be a verification of some kind to prevent spam? Maybe limit the amount of posted emails per session?

  4. @bernhard thx for your quick reply!

    2 minutes ago, bernhard said:

    Why do you think that? This is just using PW selectors and maybe comparing dates 😉 

    Maybe I am thinking about it the wrong way, but how would the script be triggerd if not with a cronjob or something? How/when would you execute the code that checks the date and sends the emails

    9 minutes ago, bernhard said:
    • subscription management (what happens if ... and what if ... and so on ...)
    • mail deliverability (not too hard but you need to be careful)
    • mail layouts (responsive, different mail clients etc)

    Subscription would be a "nice to have" feature. My performance concern above was about delivering/sending the emails from the shared hosting server. I dont't think I could use external services like MailChimp to send these mails, because they will have dynamic content in them (event name, even date, etc.). So WireMail seems like the way to go here. For the mail layout I will use css tables and inline styles, but the layout will not be that complicated  🙂

  5. Hey folks,
    I am working on a client website, which lists some events. Events are just pages and each event has a date.
    Now the client wants a solution, where people could click a button for each event to put it on a "reminder list". After they collected all the events they have interrest in, they can enter an email and get a message a day before each event happens.

    Since I never had the need to develop something like this before. Is there someone who can share a good approach to this? 
    I worked with FormBuilder before and there is also ProMailer (which I never used before), but not sure if that would help here. I also I took a look at WireMail Class which seems quite easy to use.

    I think the website runs on a shared hosting server, so not sure if the server could even handle it. But I could talk to the client to upgrade I guess.

    My approach would be like this:

    1. The email will be saved to each event page the person was interested in (maybe each event page has a field for this, where multiple emails could be stored). These Emails will not be seen by regular guest users. There will propably have to be a verification of some kind to prevent spam?
    2. There need to be some script/cronjob that checks if an event will happen soon (this seems complicated). Then an email will be send to every email that is accociated with that event.
    3. To comply to GDPR laws, the emails have to be deleted after the notification was send. (The client would like to keep them for future newsletter stuff, but than a unsubscribe button in the email isneeded).

    Any ideas or feedback is welcome. Thx in advance!

  6. @wbmnfktr  Thx!

    15 hours ago, wbmnfktr said:

    I personally prefer combining and inlining my CSS to have it right away.

    To be clear, the css my module generates is rendered in a style tag in the docuemnt head, so no file is requested here (that is the major part of the css needed to render the page). But the css files from the templates, which are optionally (only loaded if the developer puts them in the template folder and names them like the template file) are added as links. I think of them as a quick way to set some default styling. Do you think it would be better for performance to inline the content of these css files as well? My concern is that this would create more work for the server to read these files every time the page gets rendered.

    15 hours ago, wbmnfktr said:

    In terms of multiple separate files HTTP/2 allows parallel downloads so there shouldn't be any render blocking issues that throw off your page speed in a dramatic way. At least not with custom CSS. Bootstrap and UIKIT might be a different story.

    It might not be a big problem with HTTP/2. So far the performace seems to be great (100-95 lighthouse score with cache enabled). However I only testet with 4 extra files (files are about 10-15KB). So I can imagine that it would cause some performace loss with more files. But it might not be worth the trouble..

  7. Hey folks.
    My soon to be released pagebuilder modules has a feature, that it will automatically load css files.
    A page can be composed by multiple block items and each block has a template file. For each block that is added to a page, the module also looks for a css file with the same name as the template file and loads it, if it's avalable and not already loaded. This works great and it only loads the css if it is really needed. But I am a bit worried of the performance, since there is a request for each file (if not cached already). Iam not sure if the ProcessWire cache or ProCache can help here?

    So now I am looking for a good way to combine the files into one request/file and also enable that file to be cached. The problem I see here is that every page can load different files, or load them in a different order, so even if two pages share most of the same files, the combined files for these pages would be different and a request for each page would be needed, even if the file of one page is already in the cache. Maybe someone has an idea how to optimise this? Do you think it's better to combine the files or just load and cache those smaller files?

  8. @theo Hi Theo. Are you still working on this? I will release my pagebuilder module as a closed beta soon and plan to release it as a comercial module later. My module is NOT based on your module and is not using any of your code (it also works different than yours). But I like the name "PageGrid" because it really fits my module and also makes sense in the context of ProcessWire. So my question would be if it is ok to use that name for my module or if you plan to release your module with that name any time soon?

  9. On 6/25/2022 at 11:10 PM, fuzenco said:

    This is amazing. Excuse me for not reading thoroughly but does this allow building on-the-fly pages from PW fields? If so, the layout functionality is basically for creating the initial page structure as well as one-up pages?

    the layout functionality is creating the initial page structure, but It's not creating a template with fields on the fly, if that's what you mean.

    The page structure is defined by the items you add to your page. PageGrid creates a hidden page for every item that gets added to it (similar to how PageTable or Repeater Matrix work). Each item is based on a block template. A template can have multiple fields to hold your data (native ProcessWire templates and fields). You can use all the fields ProcessWire provides or add even more fields using external Fieldtype modules. But you have to create these templates yourself, as well as the markup that gets rendered.

    If you want to get started quickly, I also developed some block modules that you can install optionally, these will create templates, fields as well as a template files automatically, without the need to write any code. These blocks will cover the basic needs for most websites (containers, text, images, video, slider, maps, etc..).

    More information and documentation is coming soon.
    Until then have a look at the first post 😋

    • Like 1
  10. On 6/17/2022 at 7:31 PM, bernhard said:

    You could create a PR then 😉 

    I might do that, but I am still not sure what's the best way to implement this. I made changes to the PagesExportImport Module, but I think it would be better to implement this in the core PagesExportImport Class. That would make the feature available to the API and other modules as well. But I am not sure how to do that, because to import the meta data, the pages must be created first, so the code might only work in the module, after the pages are created. 

    • Like 1
  11. I am still working on this one. It works great and is quite flexible now. I made a couple of improvements.

    • Now the data to style the items is stored directly on the item with $page->meta(). This way, cloning pages and page reference fields work out of the box. Also there is no need for hidden fields anymore. 
    • The style panel now supports adding custom classes and assigning styles to them. These classes can be used globally on all pages (a css class is also a page).
    • The style panel now supports selecting html tags to style tags globally across the whole site.
    • I did a lot of refactoring to make the code cleaner and more efficient.

    There are still things where I am looking for feedback before releasing an open beta for this module:

    Sharing blocks and migrating pages
    I played with the core ProcessPagesExportImport and the migrator module and it seems that it's not exporting the meta() data, which is a bummer. So for now I might not be able to have a migration feature out of the box. Maybe someone else can take a look at this, but it seems to be too much hassle for me now. Importing/exporting the whole database with ProcessDatabaseBackups works as expected though. Also I did develop some block modules that you can install optionally, these will create the needed templates and fields for that block and give you a quick way to start working with PageGrid (without the need to create your own templates or install a site profile), more on that later. (Item pages are based on a block template).

    Structure of PageGrid items/pages 
    I decided to always store the items under the admin page in a seperate parent, instead of making the parent customisable (like PageTable is doing). So there is a clear separation between pages for your site and item pages. PageGrid then creates a structure looking like this (makes it easy to access the pages):

    Admin
    – PageGrid Items
       – Home items (name: for-1213)
            – Item Editor
            – Item XY
      – Another Page items (name: for-1315)
            – Item Group
                – Item XY
                – Item XY
            – Item Editor

    The structure of these pages is an exact representation of the PageGrid items/pages (sorting, child/parent relation, hidden/published). While working with PageGrid via the UI this is not so important, but I think it will make interacting with the item pages via API more flexible and clean. Adding a page to any of the item pages via API or the backend also adds the page to PageGrid. If you delete a page containing a PageGrid field, the items also get deleted. You can also sort via API (or manually under the Admin page) and the changes are reflected for the items as well. The connection is via a name like for-1213, where 1213 is the ID of the page holding the PageGrid field (inspired by repeaters). I like this setup because it gives you a lot of options to access items via API and keeps the pagetree clean. Also it will make it easier to handle migrations for pages containing a PageGrid field in the future (just import/export the page and the item page container). One downside, though, is that the methods of PageTable like $page->pt->add($newpage) or $page->pt->remove($newpage) are no longer working (PageTable is using a PageArray that is saved as the field value). Also this will not work with multiple PagGrid fields on one page (A PageGrid field can however have a page reference field to another page containing a PageGrid field, as well as having nested pages, so I see no benefit of supporting multiple fields). You can add a page to the item parent like this:

    // Add an PageGrid item via API
    $itemParent = $pages->get("for-$page->id");
    $itemParent->add($newpage)

    I am not decided if my approach is better or if I should just stick with the PageTable methods (keeping the items stored as PageArray inside the field). Since PageTable can only have one parent that you select in the field settings, all items will than be stored under the same parent, which is a bit messy.

    Not sure if any of that makes sense to you 🙂 Any feedback is welcome. More info and website is coming soon!

    • Like 7
  12. Hi folks,
    I just tried to export/import some pages with meta() data using the ProcessPagesExportImport module from the core. Unfortunately the data is not exported. Is there a way to migrate pages with meta data to a new pw installation? See the API docs for $page->meta() for more information. Since this is a relatively new addition it might not be possible yet without custom code. Since my new pagebuilder module uses the meta data to save the styling of pages I might develop something myself, just wanted to ask before..

  13. @ryan While working on my pagebuilder module I also figured out that the meta data from $page->meta() is not exported with the page. This is a real bummer, because my page builder is storing all the styling information in the corresponding $page->meta and it would be nice to use this core feature to export that data as well

  14. although the module works fine, i found an error today when you make a backup of the database. the backup cannot be restored and an error message appears. If I uninstall the module, the backup works fine again. It took me several hours to find that this module is causing the error. I did the backup using the ProcessDatabaseBackups module. Maybe someone else can confirm this?

×
×
  • Create New...