Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/2018 in all areas

  1. Just an FYI - the reason the template_id is set to the name of the template in the export is so it is translatable to another PW site where that template will likely have a different ID. This way the import process can use the supplied name to find and then set the local ID for that template.
    3 points
  2. Hello If you like, you can now download a demo of this "setup" or "snapshot". I think it's "ready enough" to try it and to see what you think. Donwload this installer file (Duplicator), put it in a web root and rename it to "installer.php" http://pwdev.square7.ch/download/installer.php.txt Put this zip in the same web root http://pwdev.square7.ch/download/2018-06-13_16-03-08-localhost.package.zip Call <yourweb>/installer.php and follow the instructions. An empty MySQL Database is required. If everything went smooth, you can log in as "admin" under /processwire using password: agu3j$Fh832a Then edit "home". You can add, delete, move, resize, dialog-edit and inline-edit the items (colums). At the bottom of the page, you will find "Grid Settings". There you can define which breakpoint will be changed when using wysiwyg resizing. This may be confusing if you change a breakpoint which does not correspond to your current screen width, because nothing happens visibly. You can hover over each element to quickly see the column settings. Some basic understanding of the Boostrap 4 Grid System is recommended (Link provided in the dialog). If you would like to change the german text in the demo, just select "Deutsch" where you see "Default" in the backend nav (AOS Feature). This demo is not about "stunning" design, it is kept as simple as possible showing the options which are there. If you would like to change the design, there is package.json in the root folder which should install everything you need. "npm install" is your friend. ? In "/site/templates/scss/shared.scss" is the sass-code shared by front- and backend. There would a be lot more to say, but I think this is enough for the moment. It's a demo, don't use it for your customers atm. ? Have fun!
    2 points
  3. IMHO building your prototype with PW gives you a solid base from which you can go in every direction. You can build just a part in Vue and let the Vue app grow over time. There's a little bit of effort involved to tie PW's pages, fields and templates and Vue templates together smoothly without a lot of overhead, but an experienced Vue dev should be able to wire that up quickly and in a reusable way (Vue would be my choice there as well). Exposing PW pages and limited write actions through ajax isn't hard to do either. It's also a walk in the park to migrate PW content into less normalized "external" tables with a small bootstrap script if performance really requires it, so unlike other CMSes where you have all kinds of different things (posts, pages, parts, whatever) in different structures, you don't really lock yourself in with PW. I agree with @LostKobrakai insofar as that there are in fact a few areas where a custom tool will get you further, like if you need a full-blown discussion forum. The choices there are rather limited if you want a good integration. Invision (the software this forum runs on) seems to be rather straight forward in that regard. I have tried my hand on a phpBB3 integration module and while the basics mostly work, it's really a PITA in some parts (like outdated examples and misleading documentation) and I've run out of time to get it into a really usable shape. There are probably a few Laravel forum components I've never heard of that can get you most of the way as a half way option. I think that will be the hardest part to decide, where will PW (or any other CMS or own development, in fact) ever only be the second best choice compared to a single purpose tool you can integrate.
    2 points
  4. @Robin S I finally found out what was breaking your (awesome) module - it was another module, of course, and one of yours too ? Specifically, it was Batcher (https://github.com/Toutouwai/ProcessBatcher) I'm converting a WP website and was using https://github.com/adrianbj/ProcessMigrator and https://github.com/nicoknoll/MigratorWordpress to import the pages from WP. The client insisted to maintain the URL structure of website.com/blog-post-here/ - hence the need for Virtual Parents to keep the page tree tidy. That's where I used Batcher to move the pages from their imported parent to the root of the website. After doing that, Virtual Parents broke. I restored a backup and tried again - this time moving the pages manually and Virtual Parents kept working fine! What I suspect the problem is: When trying to move the imported blog-posts manually, I noticed they were set up to have only one allowed parent - the blog-posts page (also created during the import). So basically, using Batcher, I was able to change the parent of pages to one that was not allowed through their template config. Not 100% that is was what was breaking Virtual Parents, but one definitely shouldn't be able to move pages with Batchers where they're not allowed to live. Thanks for all your great work!
    2 points
  5. I created a Discord Server for anyone to step by and say Hello ? https://discord.gg/3jCQgt5
    2 points
  6. I've set the template protected-pages so that only certain, non-guest user roles have access to view pages. I've also set $config->pagefileSecure = true in the config.php file so to prevents http access to file assets of access protected pages. In the protected-pages template file I use the following sample code (note use of check_access=0): $protected_pages = $pages->find("template=protected-pages, check_access=0, title~=somewords"); foreach($protected_pages as $protected_page) { echo $protected_page->title . "<br>"; echo "<img src='$protected_page->image->url' alt='$protected_page->image->description' />"; } The above code shows to guests the page title (as expected) but not the image. I would like to allow guests to access not only page titles but also image files of protected pages, and just for this occasion. Is it possible (maybe just switching pagefileSecure settings on/off at runtime)? If so, how can I make that?
    1 point
  7. Some introduction... This module is experimental and there are probably bugs - so treat it as alpha and don't use it on production websites. I started on this module because there have been quite a few requests for "fake" or "invisible" parent functionality and I was curious about what is possible given that the idea sort of goes against the PW page structure philosophy. I'm not sure that I will use this module myself, just because I don't really see a long list of pages under Home (or anywhere else) as untidy or cluttered. I would tend to use Lister Pro when I want to see some set of pages as a self-contained group. But maybe others will find it useful. At the moment this module does not manipulate the breadcrumb menu in admin. So when you are editing or adding a virtual child the real location of the page is revealed in the breadcrumb menu. That's because I don't see the point in trying to comprehensively fool users about the real location of pages - I think it's better that they have some understanding of where the pages really are. But I'm open to feedback on this and it is possible to alter the breadcrumbs if there's a consensus that it would be better that way. Virtual Parents Allows pages in Page List to be grouped under a virtual parent. This module manipulates the page list and the flyout tree menu to make it appear that one or more pages are children of another page when in fact they are siblings of that page. Why would you do that instead of actually putting the child pages inside the parent? Mainly if you want to avoid adding the parent name as part of the URL. For example, suppose you have some pages that you want to be accessed at URLs directly off the site root: yourdomain.com/some-page/. But in the page list you want them to be appear under a parent for the sake of visual grouping or to declutter the page list under Home. Example of how the page structure actually is Example of how the page structure appears with Virtual Parents activated How it works This module identifies the virtual parents and virtual children by way of template. You define a single template as the virtual parent template and one or more templates as the virtual child templates. Anytime pages using the child template(s) are siblings of a page using the parent template, those child pages will appear as children of the virtual parent in the page list and tree menu. You will want to create dedicated templates for identifying virtual parents and virtual children and reserve them just for use with this module. Features Adjusts both page list and tree flyout menu to show the virtual parent/child structure, including the count of child pages. Works everywhere page list is used: Page List Select / Page List Select Multiple (and therefore CKEditor link dialog). Intercepts the "Add page" process in admin, so that when an attempt is made to add a child to a virtual parent, the child is added where it belongs (the next level up) and the template selection is limited to virtual child templates. Intercepts moving and sorting pages in the page list, to ensure only virtual children may be moved/sorted under the virtual parent. Superusers have a toggle switch at the bottom of the page list to easily disable/enable Virtual Parents in order to get a view of what the real page structure is. Usage Install the Virtual Parents module. In the module config, enter pairs of parent/child template names in the form virtual_parent_template=virtual_child_template. If needed you can specify multiple pipe-separated child templates: virtual_parent_template=child_template_1|child_template_2. One pair of template names per line. There is a checkbox in the module config to toggle Virtual Pages on and off, but it's more convenient to use this from the page list. Notes It's important to keep in mind the real location of the virtual child pages. This module is only concerned with adjusting the appearance of page list and tree menu for the sake of visual grouping and tidiness. In all other respects the virtual children are not children of the virtual parent at all. It's recommended to select an icon for the virtual parent template (Advanced tab) so virtual parents are marked out in the page list as being different from normal parent pages. Do not place real children under a virtual parent. There is some protection against this when moving pages in the page list, but when it comes to changing a page's parent via the Settings tab the only protection is common sense. https://github.com/Toutouwai/VirtualParents
    1 point
  8. I've updated the first post with info on how to run tests from the browser, so there's no need to have command line access to the server.
    1 point
  9. Very nice solution – i had the same issue with user profile pictures … this could work… On one of my pages I have a similar setup, I provide protected files using the page and the filename and then manually serving it using the render hook… Would need to look into the code… Something like > pathtothepage/?f=filename.jpg – because you know the page, you can access the file with PageFilesManager ($page->filesManager) and then send it using http://processwire.com/api/ref/wire-http/send-file/
    1 point
  10. That's likely not going to be trivial. Adding check_access=0 in a selector to display the link is quite another thing as serving the secure file to a guest user. When you have pageFileSecure enabled, the following happens: PW prefixes the file directory site/assets/files/[PAGEID] with $config->pagefileSecurePathPrefix ("-" by default so it will be site/assets/files/-[PAGEID]) When the browsers tries to show the image (i.e. open the URL /path/to/pw/site/assets/files/1258/image.jpg in a separate request), the file isn't found by .htaccess .htaccess hands off the request to index.php index.php calls PageRender::execute with the request URL PageRender::execute checks if the request is to a file, then checks if the page it belongs to is published and viewable by the current user Since $user->hasPermission('page-view', $page) returns false (the guest user doesn't have view permissions) that fails (otherwise, PW would prefix the path now and output the file) PW outputs the 404 page Since the method where the check is are done is not hookable (and some necessary properties and methods are protected, i.e. not reachable from a hook) you'd probably have to hook before ProcessPageView::execute and duplicate a lot of code from ProcessPageView or hook after User::hasPagePermission and at least duplicate ProcessPageView::checkRequestFile in both cases, match the file URL to $page->image to prevent handing out a access to other file/image fields on the page Another approach (if the images aren't too big and the protected pages aren't too many) would be to include the real image data as data URIs: <?php foreach($protected_pages as $protected_page) { echo $protected_page->title . "<br>"; $fn = $protected_page->image->filename; $imgdata = "data:" . mime_content_type($fn) . ";base64," . base64_encode(file_get_contents($fn)); echo "<img src='$imgdata' alt='{$protected_page->image->description}' />"; } If the images are small enough but you have many pages, using PW's pagination might be an option too.
    1 point
  11. Thanks, Theo. I was able to install and play around with it. So far, it looks really nice. Great job!
    1 point
  12. I've never used pagefileSecure, but you could try temporarily to add permission with $permissions->add("name") or similar.
    1 point
  13. @Sten In home.twig, the block engagement block is nested inside the home block. In engagement.twig, this is not the case. Does it work if you either move it out of the home block in your parent template; or recreate the nested block structure in engagement.twig.
    1 point
  14. Sorry @theo ?! I don't know way I looking in all forums but not in your documentation!! sorry! btw post the answer here just if some one will need: <?php $features = $pages->find("template=single-design"); ?> <?php foreach($features as $product): ?> <?php $image_big = $product->getInputField('image_card')->getImage(); $image_right = $image_big->size(250,250); ?> <img src="<?= $image_right->url ?>"> <?php endforeach; ?>
    1 point
  15. @MarcoPLY It is all written in the README. https://github.com/theo222/ImagePickerField ImagePicker stores an URL not an image object.
    1 point
  16. .local is a special case top level domain. My guess is your change messed up some dns resolution somewhere. And I wouldn't use a tld of .localhost either, since localhost is a widely-used alias for 127.0.0.1 and is usually defined in a computer hosts file and may cause other unexpected confusion. https://en.wikipedia.org/wiki/.local
    1 point
  17. Try setting template_id as an integer: $field->template_id = $templates->get("mm_state")->id
    1 point
  18. Thanks, fixed in v197. There are other places where there's no need to add but thankfully we have $page->trashable().
    1 point
  19. 1 point
  20. Thanks Macrura for the help. To be honest, I am still wrapping my head around ajax, so I completely overlooked logging the POST requests etc. As it turns out, I had a "wonderful" typo in my code, and forgot the "()" on $page->save() that was causing the issue.
    1 point
  21. I have also on occasion tweaked the styles for the markers, so that the active one is opaque and the others transparent. That helps when you have a bunch of them close together.
    1 point
  22. I was wondering how to override the style on a PW form only to find I posted the solution above 2 years ago ??
    1 point
  23. Jep, and try it in a private window - maybe you have some old session cookies or browser cache / redirects that mess things up.
    1 point
  24. I don't know either, since I never used .local. But try to add localhost or 127.0.0.1 to your site/config.php file in the "allowed hosts" array. And maybe also delete everything that's inside site/assets/cache and reload everything.
    1 point
  25. Dear All, I'm really proud to show you my first site done with ProcessWire! ❤️ It's called "In bianco e Nerd" and it's the official site of a very active italian nerd community. This is the url: https://inbiancoenerd.com/ Actually it's a quite complex website, I'm using different templates for almost every section and a huge part of the code is dynamic (for example on the single posts i can choose from the backend to move down the title, i can change completely the header, the colors and the featured image). Then there's a special section (https://inbiancoenerd.com/links-fighi/) that is a link gallery where i post cool stuff and you can filter the results using Algolia. And...it's full of easter eggs too ? HOMEPAGE LINK GALLERY SINGLE POST SKILLS Right now i'm using these modules: - AdminOnSteroids - ColorPicker - ProFields - Social Share Buttons - And the wondeful ProCache (it works like a charm) ❤️ - And soon I'll use ImageOptim too ? Server/hosting: Cloudways (DigitalOcean) + Cloudflare ProcessWire: 3.0.105 Hope you like it! Please let me know your thoughts! Right now i'm trying to promote ProcessWire in Italy because, in my personal opinion, it's one of the best CMS i've ever tried in the last 15 years of my career. So, thank you so much for this fantastic tool and thank you all for this amazing community.
    1 point
  26. Nice addition. I personally would like to see that "not secure" badge all the time. Even way more in your face.
    1 point
  27. just tested my method and works perfectly. you sure you did it right? glad i know this works now, gonna come in handy! 1.) Create new field, call it url_override 2.) Add to your template 3.) on the Page C page, type a # into the field 4.) in your treemenu options make sure you have this: 'item_tpl' => '<a href="{url_override|url}">{title}</a>',
    1 point
×
×
  • Create New...