All Activity

This stream auto-updates   

  1. Past hour
  2. @jploch, looks like good case to use my proposed $wirearray->chunk() for. See this post for the hook you would need to add in order to use chunk()... I'm not a fan of echoing markup within functions (nothing wrong with it, just a personal preference) so I would do this: In a new include/partial named album_list.php... <?php $images_per_slide = 4; // exclude pages with no thumbnail in the selector $albums = $pages->find("parent=/work/, template=project, thumbnail!='', sort=sort"); // chunk albums into groups $albums_chunked = $albums->chunk($images_per_slide); // ditch the last group if it has less than the number of images per slide (assuming that's what you want) if( count(end($albums_chunked)) < $images_per_slide ) array_pop($albums_chunked); ?> <?php foreach($albums_chunked as $key => $slide): ?> <div class="slide" id="slide<?= $key + 1 ?>"> <div class="grid"> <?php foreach($slide as $album): ?> <a href="<?= $album->url ?>" <?= $album->thumbnail->bgset('half', 'lazyload item size1of2', array('quality' => 70)) ?>> <img src="/site/templates/img/plus-icon.svg" class="info-button"> <div class="item-info"> <div class="info-container-center"> <h3><?= $album->thumbnail->tags ?></h3> <h2>Für <?= $album->title ?></h2> <p><?= $album->thumbnail->description ?></p> </div> </div> </a> <?php endforeach; ?> </div> </div> <?php endforeach; ?> Then wherever you want to output the slides... include $_SERVER['DOCUMENT_ROOT'] . '/site/templates/partials/album_list.php'; Or if you prefer... echo $files->render('partials/album_list');
  3. Today
  4. Conceptually such a module will never be part of the ProcessWire core, however, thanks to developers there are lots of useful modules out there solving various needs such as: Think of ProcessWire as a Content Management Framework and not as a CMS. The phrase CMS is used because the ProcessWire backend is powerful enough to be called so. ProcessWire is somewhere between a CMS like Joomla and a framework like CodeIgniter. And this is done all conceptually. Those who rely on it appreciate this, that is why we are here in the first place. You might need something else, it is up to you to decide. BTW, there are similar systems out there (such as SilverStripe that comes to my mind), meaning ProcessWire is not a one-of-its-kind system at all in this regard. However it is a one-of-its-kind in its OWN category Hope this helps.
  5. Both is possible since InputfieldWrapper::get() calls InputfieldWrapper::getChildByName() /** * assuming $form is a member of InputfieldWrapper class * the return of the following api calls are similar * if the field exists the return value is an instance of Inputfield otherwise NULL */ $form->tags; $form->get('tags'); $form->getChildByName('tags');
  6. Well, only me will have access to the admin side. And since there is a superuser role built into PW (which you can't delete) would it not better to instruct it by role instead of page edit? Like, "superuser" allow, everyone else deny redirecting to another page. Just asking because maybe in the future, you want a user role that has page-edit permissions for another page (not admin.php).
  7. Yes, you can set the name for children of a page, editing the parent template "Family" settings. See: http://processwire.com/api/modules/process-template/
  8. Yesterday
  9. I'm a newbie with process wire and am still trying to think the way it thinks. One thing I am having trouble with is naming pages. How does one go about naming pages for say a list of quotes? You can't make the name of the page the whole quote as that would lead to REALLY long page names. You can't just use a random number because you would have to manually create one for each page. This is possible of course but a pain. Is there any way to give a page a random title? Or am I approaching this all wrong (most likely). The same problem could occur for a list of FAQs though FAQ questions are usually shorter than quotes would be but not always. Thanks for any help.
  10. Thank you Michael, that's exactly what I was looking for. My module is already creating it's fields / templates etc. itself during install using the existing ProcessWire API which works amazingly. I should be up and running pretty quickly :-D
  11. Depends how many roles you have, whether any of those non-superuser roles need admin access, whether you will be adding new roles in the future, etc. But in general if a role has no permission to edit pages then you could say they have no business accessing the admin, and that way you don't have to maintain some list of authorised/non-authorised roles.
  12. Yes, they only see the Continue page as now, but I don't like them to see anything at all, not even that its ProcessWire. I guess editing the admin page would be the quickest way, thank you. I see you used the page-edit as a variable check before redirection. Isn't it better to test the role group? Like if not super admin or administrator, then redirect?
  13. I was just doing something similar the other day and managed to get the latest PW installed with one command. Requirements are to have the latest version of Wireshell installed globally via composer. (idea - maybe wireshell could be packaged into a distributable Phar file to make this even easier…) You then need a database and user setup (or just a database user that is allowed to create databases) To create a new PW install with a blank profile in the current directory run this long command with your own details: wireshell new . --profile=blank --dbUser=yourDBuserName --dbPass=yourDBuserPassword --dbName=yourDBname --timezone=Europe/Zurich --httpHosts=yourHostName --username=yourPWadminName --userpass=yourPWadminSecurePassword --useremail=yourEmail.com (idea - maybe these details could be loaded from an external config file for easier CI workflow / setup…) After this you could import fields and templates via Wireshell and I’ve not tested this but on the wireshell forum thread someone mentioned that you can also load templates / fields via a separate json files.
  14. If the role doesn't have page-edit permission and doesn't have profile-edit permission then they cannot see the page list or edit their profile. They just see this: But to prevent them from seeing the admin interface at all you can add this at the top of /site/templates/admin.php... if($user->isLoggedin() && !$user->hasPermission('page-edit')) { // Uncomment whichever you prefer // $session->redirect('/'); // throw new Wire404Exception(); }
  15. I didn't mean to question PW's concept in general, although I don't share your opinion that a content management system ought to be concerned as little as possible with the way content is being presented. IMO content and layout are equally important, more so a convincing layout can sucessfully sell poor content (one of the simpler marketing rules). But that's not the point. By calling the handling kind of "behind the times", I was referring to the fact that files a) have to be created and hardcoded by hand and b) reallocated on the server (requiring FTP or other connection types). What is keeping PW from providing a little file manager and a code editor, ideally providing field variables and other snippets, so that everything can quite comfortably be achieved right in the backend?
  16. Are you talking about inputfield dependencies? From the docs...
  17. Module

    Installing via "Add module from URL" is nearly as easy: https://github.com/somatonic/ClearCacheAdmin/archive/master.zip But I agree it would be great to have this module in the directory.
  18. Is there a way I can restrict the admin backend only to administrators? I changed it to a random name so users can't access it by mistake but there certainly should be a better way. I noticed that if I'm logged as a user, I can access the admin side and change profile, view pages, etc. I don't want this, even without permissions, they can still view it, and while I do want users to be able to change their username and password in the future, I think I would be better off creating a template page just for those functions rather than allowing them to access the admin side.
  19. Does this not work? if( strtolower( $attach_file->title ) == 'yes' ) { // do whatever }
  20. There is a page field say, attach_file value of either yes or no another file field will depend on that field when 'yes' is selected. I tried attach_file.title='yes' or attach_file->title='yes' , both are not working
  21. Remove the link and it should kick in again. Needs to just be plain text.
  22. If you need extra customisation, try out ParsedownExtraPlugin.
  23. Oh hell. I could of sworn I tried that. Upon getting your confirmation I tried again and it worked. I probably had some character out of place. Thanks. So the take-a-way is: You can use Markdown in your field descriptions. Great!
  24. Shouldn't it actually be this? $form->insertAfter($field, $form->getChildByName('tags'));
  25. Hi @Chris Falkenstein You can use markdown or textile syntax in description of fields
  26. Only just a thought: It would make more sense to offer only the possibillity to enter just a start date without a time. If there is a start time, there should also be an endtime. So if you remove the time setting from the inputfield for the date it means there is an event on that date which is all day long. If there is a need to restrict an event via a start and end time we can add 2 PW time fields to the template. This is the case if there is fe a course the starts and ends at a certain time. This looks better than using the time field from the module field for the starting time and another time field from another PW field type for the endtime (2 different fieldtypes with different looks). Another case would be that a store is fe closed on that day (inventory or something else). The shop is closed the whole day. So there is no need to enter a start time - it is an all day event. We dont need a start time in this case. Conclusion: I think a date only field without the possibility to add the time would be a better fitting solution in this case. If you want you can add 2 time fields to the template or not (depending on your needs). No mixin of 2 different fields necessary. Best regards
  27. Hello. I'd like to include a link in my field description. See attached, highlighted in yellow, so we're all clear on what a field description is. I'd be nice to offer a link to a Markdown guide (in this case). Is this possible to use HTML to create a link in the description. I'm not looking for any hacky ways here. I was hoping it was something I could just do or option that I could tick. Thanks.
  1. Load more activity