Jump to content

dotnetic

Members
  • Posts

    864
  • Joined

  • Last visited

  • Days Won

    8

dotnetic last won the day on February 15 2020

dotnetic had the most liked content!

Contact Methods

  • Website URL
    https://dotnetic.de
  • Skype
    jens.martsch

Profile Information

  • Gender
    Male
  • Location
    Münster, Germany

Recent Profile Visitors

9,560 profile views

dotnetic's Achievements

Hero Member

Hero Member (6/6)

962

Reputation

  1. Might be a good time to rewrite/expand this tutorial with using vite
  2. Depending on what you want to do, Alpine JS might not be a good alternative. A big drawdawn ist, that it doesn't use a virtual DOM and can get slow if you want to render many nodes, for example if you want to render many list entries with a pagination. At some point your browser will get slow and sluggish. But it is very good and easy in many other cases. There are also other good libraries out there, that have a similar purpose like vuejs/petite-vue: 5kb subset of Vue optimized for progressive enhancement (github.com) (also does not use a virtual DOM, so the same drawback as Alpine) which shares the same template syntax and reactivity mental model with standard Vue or there is riot.js. Petite-vue might be the right choice for you @jploch. Vite is great and really fast and I am happy to have it as a replacement to webpack and I use it since it appeared in most projects (well actually it is not really a replacement for webpack, because it is NOT a bundler, but it serves a similar purpose).
  3. There is a hook Pages::cloned $this->addHookAfter('Pages::cloned', $this, 'pageCloned') and you can interact with the cloned page: /** * @param HookEvent $event * Method to change the status of a cloned page */ public function pageCloned(HookEvent $event) { // $return = $event->return; $page = $event->arguments(0); $clone = $event->arguments(1); $clone->of(false); $clone->modified = date("Y-m-d H:i:s"); $clone->created_users_id = $this->user->id; $clone->save(array('quiet' => true)); }
  4. Really nicely designed website. I like it!
  5. Please open the dev tools of your browser and take a look if there are errors in the console or if there are 404 errors in the network panel. I think that the paths might be wrong. In dev tools network tab you will see from where the browser tries to load the assets. Also the rel="stylesheet" in your script tag absolutely makes no sense, please remove it.
  6. I just released the latest version with some fixes from @bernhard. Thanks for the corrections. I also updated the dev branch with latest translations to the core 3.0.180. Enjoy
  7. In your post you wrote two different directories. First you mention an "img" folder, then you try to acces the "imgs" folder. Please check that you are using the correct path.
  8. This is the normal way of rendering output, but as with almost everything in ProcessWire it is up to you. For example you could use your own render logic via _init.php without the need for any other .php file. Or you could integrate a template language like Twig or Smarty via Template Engine Factory.
  9. 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.
  10. You have to set and use the correct locale for italian. Please read this post and set the C setting to "it_IT" or the locale that you found with the script from the first post. How to do it is written in the comment "Warning about Server Locale after update from 3.0.52 > 3.0.53 - Help! - Page 2 - General Support - ProcessWire Support Forums" .
  11. Thanks for your continued development on this. I still need to have a look at it.
  12. You found the solution just 4 years after posting this thread?! Wow. That's fast 😉
  13. The problem is, that you forgot to insert the {class} placeholder in the itemMarkup option which inserts the active class to the active element. It has to look like this <li class='page-item {class}'>{out}</li> so that the active class can be added.
  14. Thank you @Pete for your work on the forum.
×
×
  • Create New...