Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/30/2019 in all areas

  1. Relative to the last dev branch version (3.0.127) version 3.0.128 contains 40 commits, mostly specific to resolving older GitHub issue reports. If you are interested, here is the commit log: https://github.com/processwire/processwire/commits/dev — version 3.0.128 covers commits between March 2nd and today. We're down to about 77 remaining issue reports, mostly older stuff that didn't get covered in the past for one reason or another, but we're making good progress. Similar updates will be continuing next week, and I've also got several ProMailer updates coming out next week too. Hope you all have a great weekend!
    7 points
  2. Access By Query String Grant/deny access to pages according to query string. Allows visitors to view protected pages by accessing the page via a special URL containing an "access" GET variable. This allows you to provide a link to selected individuals while keeping the page(s) non-viewable to the public and search engines. The recipients of the link do not need to log in so it's very convenient for them. The view protection does not provide a high level of security so should only be used for non-critical scenarios. The purpose of the module was to prevent new websites being publicly accessible before they are officially launched, hence the default message in the module config. But it could be used for selected pages on existing websites also. Once a visitor has successfully accessed a protected page via the GET variable then they can view any other page protected by the same access rule without needing the GET variable for that browsing session. Superusers are not affected by the module. Usage Install the Access By Query String module. Define access rules in the format [GET variable]??[selector], one per line. As an example the rule... rumpelstiltskin??template=skills, title~=gold ...means that any pages using the "skills" template with the word "gold" in the title will not be viewable unless it is accessed with ?access=rumpelstiltskin in the URL. So you could provide a view link like https://domain.com/skills/spin-straw-into-gold/?access=rumpelstiltskin to selected individuals. Or you could limit view access to the whole frontend with a rule like... 4fU4ns7ZWXar??template!=admin You can choose what happens when a protected page is visited without the required GET variable: Replace the rendered markup Throw a 404 exception If replacing the rendered markup you can define a meta title and message to be shown. Or if you want to use more advanced markup you can hook AccessByQueryString::replacementMarkup(). $wire->addHookAfter('AccessByQueryString::replacementMarkup', function(HookEvent $event) { // Some info in hook arguments if needed... // The page that the visitor is trying to access $page = $event->arguments(0); // An array of access keys that apply to the page $access_keys = $event->arguments(1); // The title $title = $event->arguments(2); // The message $message = $event->arguments(3); // Return some markup $event->return = 'Your markup'; }); Screenshot https://github.com/Toutouwai/AccessByQueryString https://modules.processwire.com/modules/access-by-query-string/
    2 points
  3. Thank you! I might give it a try. It would be really helpful, the way I believe repeaters are meant to be used, if we could sort them by fields, or set new items to be placed on top of the list... Basically a more flexible element. And by the way - I'm so happy about processwire and the way it works ?
    2 points
  4. There‘s no fixed list of things creating variations. You might install a new module, which creates ones or you setup the admin theme to use images as avatars, which might use a different size to the image inputfield preview. An update to processwire might change the dimensions of variantions used (even though Ryan is quite careful with those changes).
    2 points
  5. @Robin S has already provided us with hundrends of goodies, one of them this deals with it: https://github.com/processwire/processwire-issues/issues/70#issuecomment-258023285 same in the forum: https://processwire.com/talk/topic/1674-sorting-repeater/?do=findComment&comment=131713
    2 points
  6. Introducing ProcessWire ProFields: Table – it lets you literally define your own Fieldtype! This is one of the most exciting ProFields and it's something very different than any other Fieldtypes. I think it is best described by this screencast (be sure your sound is on): Special thanks to Joss for his great voiceover on this screencast. Please view the video at 720p and full screen if possible. Read more about the Table Field Table is part of the ProcessWire ProFields package now available for purchase in the ProcessWire store.
    1 point
  7. You could use something like this: $refs = $pages->find("template=project, title%=Zürich, include=all, limit=3"); // limit here just for testing small result-sets $count = count($refs); $last = $count-1; $c = 0; echo "<p>$count</p>"; foreach($refs as $r) { switch (true) { case ($c === 0): echo "<hr><strong>FIRST: {$r->title}</strong><br>{$r->project_desc_short}"; break; case ($c === 1): echo "<hr><strong>SECOND: {$r->title}</strong><br>{$r->project_desc_short}"; break; case ($c === 2 && $c === $last): echo "<hr><strong>LAST: {$r->title}</strong><br>{$r->project_desc_short}"; break; case ($c === 2 && $c != $last): echo "<hr><strong>THIRD: {$r->title}</strong><br>{$r->project_desc_short}"; break; default: echo "<hr><strong>DEFAULT: {$r->title}</strong><br>{$r->project_desc_short}"; break; } $c++; } echo "<hr><br>" . $refs->count . " Referenzen gefunden"; see also https://www.phpknowhow.com/basics/if-else-and-switch-case/#highlighter_461554 Perhaps you could use this technique (PHP 7.2+), with goto: https://derickrethans.nl/php7.2-switch.html
    1 point
  8. It seems strange you get a 500 error for something so trivial. Perhaps you have other code you've stripped from your post that causes an endless loop or redirect... You can try this: $refs = $pages->find("template=project, title%=Zürich, include=all"); $count = count($refs); $last = $count-1; $c = 0; foreach($refs as $r) { switch ($c) { case 0: echo "<hr><strong>FIRST: {$r->title}</strong><br>{$r->project_desc_short}"; break; case 1: echo "<hr><strong>SECOND: {$r->title}</strong><br>{$r->project_desc_short}"; break; case 2: echo "<hr><strong>THIRD: {$r->title}</strong><br>{$r->project_desc_short}"; break; case $last: echo "<hr><strong>LAST: {$r->title}</strong><br>{$r->project_desc_short}"; break; default: echo "<hr><strong>DEFAULT: {$r->title}</strong><br>{$r->project_desc_short}"; break; } $c++; }
    1 point
  9. Indeed, at the moment there is no version available for testing, but this will change pretty soon. Since the RepeaterFlex is pretty similar to the RepeaterMatrix regarding its use (yet totally different regarding configuration), I've requested @ryan for an approval first on how to proceed. As a result the RepeaterFlex will be made available from the ProFields board after some final cleanup and documentation. ...hopefully next few days.
    1 point
  10. probably not, since any file placed into your webspace will be served directly, they do not need to follow any particular nomenclature - that's just files. Happens also to any .js and .css files buried somewhere in a module's folder, for example. Before implementing admin pages for this purpose, why not simply extending InputfieldImage? You may use ImageExtra as a starting point...
    1 point
  11. You can use a hook like this in /site/ready.php: $wire->addHookBefore('InputfieldPageAutocomplete(name=link_page_url)::render', function(HookEvent $event) { $inputfield = $event->object; // Get the page being edited $page_id = $event->wire('input')->get->int('id'); $edited_page = $event->wire('pages')->get($page_id); // If the edited page is one that you want to target if($edited_page->template == 'basic_page') { // Append to the findPagesSelector property to exclude pages you don't want to match $inputfield->findPagesSelector .= ', has_parent!=/menus/'; } });
    1 point
  12. I recently mentioned that I was working (more like messing about quickly :-)) on a Visualisation module based on the awesome chart lib Vega. I haven't touched this module in a while. I only realised today as I was transferring my dev setup to WampServer and testing things out that I'd left this off at a stage where one could view a basic Viz. See the screenshots below. Word of warning: this does not even qualify as pre-alpha in my opinion. It is very early days. It is more of a playground to test ideas. It's also not high in my list of priorities so I don't know when it will be ready... Screenshots Create new viz from list of pre-built visualisations/charts Editing a single visualisation/chart
    1 point
  13. Thanks @horst ! Checking that this week-end - thanks for the sample too ! ?
    1 point
×
×
  • Create New...