Jump to content

MateThemes

Starter
  • Content Count

    34
  • Joined

  • Last visited

Community Reputation

11 Good

1 Follower

About MateThemes

  • Rank
    Jr. Member

Contact Methods

  • Website URL
    https://mate-themes.com

Profile Information

  • Location
    Austria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Here is my Patreon! https://www.patreon.com/matethemes If you wanna support the work... Processwire is the greatest CMS I have ever seen.
  2. Hello everyone! I decided to develop a marketplace for Processwire. What do you think about that? It should be a centralized place for modules and profiles! Who wanna to collaborate with me?
  3. I am really looking forward for this ecommerce module. Are there any plans about pricing for the module for now? Thank you!
  4. Hello everyone! So as far as I understand the discussion, it is not possible to make a repeaterfield searchable in a repeater matrix. Is this right? Thank you!
  5. Thank you very much for this starting tutorial! I love to work with Twig. I am switching over from OctoberCMS to Processwire and it is hard to get over from Twig template files to a plain PHP. So I am happy to have a starting point to start working with Twig in my Processwire Projects. Greetings from Austria to Germany
  6. Thank you for your answer. It seems like the problem is, that the field is in a repeater matrix and then in a repeater. The hierarchy is: - repeater_matrix -- aboutusblock_repeater ---- textfield Could that be?
  7. Hello everyone! I am trying to add my repeater matrix fields to the search selector, but unfortunately nothing seems to work for me. I have following search code in my search.php: <?php namespace ProcessWire; // look for a GET variable named 'q' and sanitize it $q = input()->get('q'); // sanitize to text, which removes markup, newlines, too long, etc. $q = sanitizer()->text($q); // did $q have anything in it after sanitizing to text? if($q) { // Make the search query appear in the top-right search box. // Always entity encode any user input that also gets output echo '<input id="search-query" value="' . sanitizer()->entities($q) . '">'; // Sanitize for placement within a selector string. This is important for any // values that you plan to bundle in a selector string like we are doing here. // It quotes them when necessary, and removes characters that might cause issues. $q = sanitizer()->selectorValue($q); // Search the title and body fields for our query text. // Limit the results to 50 pages. The has_parent!=2 excludes irrelevant admin // pages from the search, for when an admin user performs a search. $selector = "title|body~=$q, limit=50, has_parent!=2"; // Find pages that match the selector $matches = pages()->find($selector); } else { $matches = array(); } // unset the variable that we no longer need, since it can contain user input unset($q); ?> <main pw-replace='main'> <?php include('./includes/_pageheadersearch.php'); ?> <div id='content-body' class='uk-section uk-section-large uk-section-large'> <div class='uk-container uk-container-small'> <?php // did we find any matches? if(count($matches)) { // yes we did, render them echo ukAlert(sprintf(_n('Found %d page', 'Found %d pages', $matches->count), $matches->count), "default", "check"); echo ukDescriptionListPages($matches); } else { // we didn't find any echo ukAlert(__('Sorry, no results were found'), "danger", "warning"); } ?> </div> </div> </main> I have tried to add my fields to the selector code (repeater_matrix.aboutsblock_repeaters.mytextfield) . But I didn't get any results. What I am doing wrong? Thanks for your help!
  8. I have found a solution, that worked for me. I just put in the module file at line 523 a isset statement: /** * Hook format extra fields * * @param HookEvent $event */ public function formatExtraValue(HookEvent $event) { $page = $event->arguments(0); if (!isset ($page->data['title'])) { $field = $event->arguments(1); $value = $event->arguments(2); $settings = $this->getOtherFieldSettings($field); if ($settings && $formatters = $settings->cf_textformatter) { foreach ($value as $v) { foreach ($this->additionalFields['other'][$field->name] as $otherField) { if (!array_key_exists($otherField, $formatters)) continue; $formatter = $formatters->$otherField; $currentValue = $v->$otherField; if ($formatter) $this->modules->get($formatter)->formatValue($page, $field, $currentValue); $v->$otherField = $currentValue; } } } } } And this works for me.
  9. I've got the same error here. I use the Image in a Repeater. Is there any workaround at this time? Although the module works fine, to have an error is annoying. Thanks for your help!
  10. MateThemes

    Datetime format

    Hello everyone. I have a question that i can't find a way to solve. I have following function in _uikit.php $date = $page->get('date|createdStr'); $dateModified = $page->get('datemodified'); But I need to output the $date in to different formats. My further function looks like this // return the blog post article markup return " <div> <article class='uk-article blog-post $class'> <meta property='name' content='$page->title'> <meta property='author' typeof='Person' content='Arra Lifte Harmanschlag'> <meta property='dateModified' content='$dateModified'> <meta property='datePublished' content='$date'> <meta class='uk-margin-remove-adjacent' property='articleSection' content='News'> <div property='image' typeof='ImageObject'> $featuredBlogPostImage </div> $heading <ul class='mt25 uk-margin-remove-bottom uk-subnav uk-subnav-divider'> <li class='uk-article-meta'> <time datetime='$date'>$byline</time> </li> </ul> <div class='mt25' property='text'> $body </div> </article> </div> "; Now I need to output the meta property in this format 2019-03-02CET05:23:00 and then a normal date format that is displayed on the Homepage with 2. März 2019 without time. Can anybody help me? Thanks in advance.
  11. I have found it! It was my mistake!!! In this function function ukAlert($html, $type = '', $icon = '') { $out = $type ? "<div class='uk-alert-$type uk-alert'><a class='uk-alert-close' uk-close></a><p>" : "<div data-uk-alert><a class='uk-alert-close' uk-close></a>"; if($icon) $out .= ukIcon($icon) . ' '; $out .= $html . "</p></div>"; return $out; } I have forgot to add uk-alert <div class='uk-alert-$type uk-alert' uk-alert> function ukAlert($html, $type = '', $icon = '') { $out = $type ? "<div class='uk-alert-$type uk-alert' uk-alert><a class='uk-alert-close' uk-close></a><p>" : "<div data-uk-alert><a class='uk-alert-close' uk-close></a>"; if($icon) $out .= ukIcon($icon) . ' '; $out .= $html . "</p></div>"; return $out; }
  12. Hello everybody! I use the Regular blog site profile as my starter template for my new website. I also use the included uikit.php with reusable functions. But I have one question to this uikit.php. If render an ukAlert the close trigger is not working. If i hard code the alert box, everything is working fine. Here is the code I use (it is not modified and is provided by the Regular blog site profile): /** * Render a uikit alert box * * @param string $html Text/html to display in the alert box * @param string $type Specify one of: success, primary, warning, danger or leave blank for none. * @param string $icon Optionally specify a uikit icon name to appear in the alert box. * @return string * */ function ukAlert($html, $type = '', $icon = '') { $out = $type ? "<div class='uk-alert-$type uk-alert'><a class='uk-alert-close' uk-close></a><p>" : "<div data-uk-alert><a class='uk-alert-close' uk-close></a>"; if($icon) $out .= ukIcon($icon) . ' '; $out .= $html . "</p></div>"; return $out; } /** * Render a success alert, shortcut for ukAlert('message', 'success'); * * @param string $html * @param string $icon * @return string * */ function ukAlertSuccess($html, $icon = '') { return ukAlert($html, 'success', $icon); } /** * Render a primary alert, shortcut for ukAlert('message', 'primary'); * * @param string $html * @param string $icon * @return string * */ function ukAlertPrimary($html, $icon = '') { return ukAlert($html, 'primary', $icon); } /** * Render a warning alert, shortcut for ukAlert('message', 'warning'); * * @param string $html * @param string $icon * @return string * */ function ukAlertWarning($html, $icon = '') { return ukAlert($html, 'warning', $icon); } /** * Render a danger alert, shortcut for ukAlert('message', 'danger'); * * @param string $html * @param string $icon * @return string * */ function ukAlertDanger($html, $icon = '') { return ukAlert($html, 'danger', $icon); } Here is the code in the template: <?php // did we find any matches? if(count($matches)) { // yes we did, render them echo ukAlert("Found $matches->count page(s)", "default", "check"); echo ukDescriptionListPages($matches); } else { // we didn't find any echo ukAlert("Sorry, no results were found.", "danger", "warning"); } ?> May someone have the answer to this! Thanks in advance!
  13. Hello everybody!!! It is me again with a beginner question. I have following function defined in uikit.php and used in my search-template <?php // did we find any matches? if(count($matches)) { // yes we did, render them echo ukAlert("Found $matches->count page(s)", "default", "list"); echo ukDescriptionListPages($matches); } else { // we didn't find any echo ukAlert("Sorry, no results were found.", "danger", "warning"); } ?> Now, how can I make the ukAlert translatable as a string? I didn't find a way to get it work! Thanks for your help in advance!!!
  14. Thank you very much for your answer!!! This helps me a alot!!! I am still new to Processwire but I love it more and more!!!
×
×
  • Create New...