Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/17/2021 in all areas

  1. Hello everyone, We're looking for someone to join our team full time as a User Experience Developer. This role is about evolving our UI design system in HTML/CSS/JS as we continuously improve our web sites (built on ProcessWire of course!), email marketing, and other digital channels. The ideal candidate will be a creative thinker who also understands how design choices impact SEO, performance, accessibility, and standards compliance. It's a great company (70+ years old, multi-generational family owned) with excellent pay and benefits, and we are remote friendly. Get more info and apply here: https://mchl.mn/uxd Thanks, Jason
    4 points
  2. <?php $page->of(false); $page->yourfield->add("https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Processwire_logo.svg/2560px-Processwire_logo.svg.png"); $file = $page->getUnformatted('yourfield')->last(); $file->description = 'hello world'; $page->save(); getUnformatted ensures that you get the files as array and then retrieve the last file ?
    3 points
  3. Here's a hook that might help: $wire->addHookBefore('ProcessModule::executeEdit', function(HookEvent $event) { if($event->wire()->input->get('name') !== 'YourModuleName') return; $event->wire()->addHookBefore('InputfieldForm::render', function(HookEvent $event) { /** @var InputfieldForm $form */ $form = $event->object; if($form->id !== 'ModuleEditForm') return; $your_module = $event->wire()->modules->get('YourModuleName'); if($your_module->foo === 'bar') { $uninstall = $form->getChildByName('uninstall'); $uninstall->description('You may not uninstall this module because foo equals bar.'); $uninstall->attr('disabled', 'disabled'); } }); }); Update: an example in the context of your module... public function ready() { $this->addHookBefore('ProcessModule::executeEdit', $this, 'disableUninstall'); } protected function disableUninstall(HookEvent $event) { if($this->wire()->input->get('name') !== $this->className) return; $this->wire()->addHookBefore('InputfieldForm::render', function(HookEvent $event) { /** @var InputfieldForm $form */ $form = $event->object; if($form->id !== 'ModuleEditForm') return; if($this->foo === 'bar') { $uninstall = $form->getChildByName('uninstall'); $uninstall->description('You may not uninstall this module because foo equals bar.'); $uninstall->attr('disabled', 'disabled'); } }); }
    3 points
  4. Restaurant Blechnapf Neumünster - https://www.restaurant-blechnapf.de/ Fine culinary dining combined with a similar fine setup of design and webdev can be found at Blechnapf, Neumünster. One of our oldest partners in crime culinary highlights. Classic german dishes, experimental dishes based on classic dishes and even very own creations of all-time classics. Even though they are officially targetting your taste buds you can find a lot of more adventures there. They offer support for all kinds of experiences from readings, poetry slams, business meetings and even weddings (just in case you are around this wonderful place). Design details A classic modern setup of goodness (which got a very recent visual upgrade with way more and bold colors) - as someone described it already. Nothing super fancy, yet classic, modern, and with a very personal own style. Website, printed menue cards and even vcards come in the same style. Guess what was first. ;) Technical details PageHitCounter RepeaterMatrix (Pro) Import Pages from CSV Markup Sitemap XML PrivacyWire Simple Contact Form The team behind this: Muskaat for the technical part (yes, I'm part of Muskaat) https://www.muskaat.de/ Polimorf for the design part https://www.polimorf.de/ I hope you'll enjoy this site as much as I do!
    2 points
  5. One way is to tell them to have the Hannacodes side by side, just like the buttons would be [[special_button url='example1.com' label='Visit Example1.com']][[special_button url='example2.com' label='Visit Example2.com']] But this depends on the html code that you are generating for that Hanna code. For that to work, you would need the root html tag of each of those buttons to be displayed as "inline-block" on your CSS. Another option is to use a single Hanna Code for both buttons, and style them to be side by side. This would give you more control over the styling, since you can have a parent tag around the two buttons. [[special_button url='example1.com' label='Visit Example1.com' url2='example2.com' label2='Visit Example2.com']] This could be the same Hanna code for single and double buttons. If the url2 is not given, show a single button, if it is given, create the second button. A shorter alternative might be: [[special_button url='example1.com|example2.com' label='Visit Example1.com|Visit Example2.com']] For this you would have to explode() the value of "url" and "label" by the "|" separator, and create one button for each value in the resulting array.
    2 points
  6. Absolutely, both options seem reasonable — I'll add this to my todo list!
    1 point
  7. @teppo Hi and thanks for the great tool! Have a small issue with $persistent_cache_name in the current implementation it's not language-aware. Maybe it worth changing it to something like $persistent_cache_name = 'Wireframe/MethodProp' . '/' . $context . '/' . static::class . '/' . $name . '/' . $this->wire('page'); if($this->wire()->modules->isInstalled("LanguageSupport")) { $current_language = $this->wire()->user->language; $default_language = $this->wire()->languages->getDefault(); if ($current_language !== $default_language) { $persistent_cache_name .= . '/' . $current_language->id; } } or even move out to a separate hookable method, so we can tune names if needed.
    1 point
  8. As I mentioned you have to check if the correct locale is installed first. Because if you set it in ProcessWires "C" setting to it_IT or it_IT@euro and the locale is not installed, then you don't get the localized dates. And I forgot that you have to use strftime to get a localized date. You can find a description later in this post. The easiest way to check what locales are installed is to run `locales -a` if you have shell access (SSH for example). If this is not possible, then you have to modify my script from the first post and insert different values for italian there. <?php echo '<h1>test for locales</h1>'; /* try different possible locale names for italian GB as of PHP 4.3.0 */ echo '<p>'; $loc_it = setlocale(LC_ALL, 'it_IT', 'it_IT@euro', 'it_IT.UTF-8'); echo "Preferred locale for italian on this system is '$loc_it'"; echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978)); function smarty_modifier_number_format( $string, $decimals = 2 ) { $locale = localeconv(); // setlocale( LC_NUMERIC, null ); $string = str_replace(',', '.', $string); $thousand_separator = ( $locale['thousands_sep'] == '' ) ? '.' : $locale['thousands_sep']; $decimal_separator = $locale['decimal_point']; return @utf8_encode(number_format( $string, $decimals, $decimal_separator, $thousand_separator )); } echo "<br>"; echo smarty_modifier_number_format('12,90 g'); If you run it then, and the preferred locale is not an italian one, then an italian locale might be missing on the system and you have to tell your host to install it, if that is possible. When switching languages, you have to set the locale for example in your _init.php setlocale(LC_ALL, 'it_IT', 'it_IT.UTF-8', 'it_IT@euro'); and then to get a localized date you have to use the strftime function or ProcessWire's date method (which can be formatted using strftime) for output. If the italian locale is missing, you could use a custom PHP function that returns dates in your language.
    1 point
  9. Yes, that works!! Hook inside hook -> nice combination. That was exactly what I was looking for!! Problem solved!! ? Thanks!!!!!!
    1 point
  10. Damn, what a noob. That was it. How does one make a full project, publish it, test it, and never see a broken pages or a piece of red text anywhere saying Hey, where's your <body> tag? A mistery. Thank you sir, beer's on me ?
    1 point
  11. "data-phc" attribute is missing on body tag. Are you sure you have body at all?
    1 point
  12. If you can build enough discipline in the way you write conditionals, you can avoid this by always putting the constant part first: if ('xx' == $page->template->name) { So if you accidentally miss an equals sign and do an assignment, you get an error from the runtime as you are trying to assign to a constant string literal. I've tried to build this habit over the years and sometimes remember to do this - but I'm not there yet.
    1 point
  13. Changelog for Wireframe 0.14.0: ### Added - New ComponentView class, as well as the ability for component views to access Component class public methods as properties, in the same way view files and layouts can access Controller class public methods. ### Changed - Hook related code moved from Wireframe module to separate Hooks class. - Accessing public class methods as properties in view files were moved into new trait MethodPropsTrait. This is used internally by Controller and Component classes. - Some minor improvements related to dependency injection within Wireframe objects (and ProcessWire objects instantiated by Wireframe.) @bernhard, what you suggested here... ... is now doable. The way it works is just like with Controllers (this functionality is provided by a new shared trait behind the scenes): <?php // component class namespace Wireframe\Component; class Test extends \Wireframe\Component { public function hello() { return 'world'; } } // component view hello <?= $this->hello ?>
    1 point
  14. 1 point
×
×
  • Create New...