Jump to content
David Karich

Module: AIOM+ (All In One Minify) for CSS, LESS, JS and HTML

Recommended Posts

Calling AIOM/chmod experts...

Just today a whole website of mine using AIOM ceased to function.

Precicely 1 month after installing AIOM on the site, I was getting a 500 error. Looking at the PW log file I saw countless repetitions of...

2014-10-18 15:59:18	guest	http://***.com/?/	Error: 	Exception: The permissions (chmod) to delete old cache files could not be changed. (in /srv/***/www/***.com/public_html/site/modules/AllInOneMinify/AllInOneMinify.module line 646)

So, I guess one or more of my cached files had hit a 30 day expiry date.

I did a bit of investigating, and it seems that before deleting cache files, AIOM like to chmod 777 the file. If it can't chmod the file, it throws this error and stops the site loading. No logging into PW admin, nothing.

It seems similar to this problem here:

https://github.com/ryancramerdesign/ProcessWire/issues/648

And the exact line of code in question is highlighted by Ryan there. https://github.com/FlipZoomMedia/ProcessWire-AIOM-All-In-One-Minify/blob/AIOM%2B/AllInOneMinify.module#L641... It's line 646.

Is there any real need to change the permissions to 777 before deleting?

The problem in my case is that www-data doesn't own these files. I copied this installation over from another server, and the owner (chown) is actuall "admin". But I have group rw permission to www-data, so the files can be deleted. I think that should be okay, right?

So, what I did was comment line 646 and added the following three lines

        // ------------------------------------------------------------------------
        // Remove all files that are older than the maximum lifetime.
        // ------------------------------------------------------------------------
        foreach ($_cacheFiles as $_cacheFile) {
            if (((filemtime(wire('config')->paths->assets.self::$cacheDir.DIRECTORY_SEPARATOR.$_cacheFile->getFilename()) + self::$cacheMaxLifetime) < time() OR $force_all === true) AND is_file($_cacheFile)) {
                $_file  = wire('config')->paths->assets.self::$cacheDir.DIRECTORY_SEPARATOR.$_cacheFile->getFilename();
                if(chmod($_file, 0777) !== false) {
                    if(unlink($_file) === false) {
                        throw new WireException('The old cache files could not be deleted.');
                    }
                } else {
                    // throw new WireException('The permissions (chmod) to delete old cache files could not be changed.');
                    if(unlink($_file) === false) {
                        throw new WireException('The old cache files could not be deleted.');
                    }                    
                }
            }
        }

And now everything seems to work again.

Stuff like this sort of scares me. The last thing I want is for sites to completely and arbitrarily stop working!

I literally just had this error, and had to apply the fix mentioned. This was never fixed?

Share this post


Link to post
Share on other sites

I literally just had this error, and had to apply the fix mentioned. This was never fixed?

Please update AIOM to the latest version 3.2.3. This problem has been fixed with the chmod and uses ProcessWire-own functions for it. This should not happen anymore.

  • Like 1

Share this post


Link to post
Share on other sites

Hello,

I'm using an HTTP/2 server so the recommended way is to have separate CSS/JS without merging them but when I try for example to minimize 5 files, at least 1 file is getting duplicated. This is issue doesn't happen when I merge them.

Can you please fix it?

Thanks

Share this post


Link to post
Share on other sites

Hello,

I'm using an HTTP/2 server so the recommended way is to have separate CSS/JS without merging them but when I try for example to minimize 5 files, at least 1 file is getting duplicated. This is issue doesn't happen when I merge them.

Can you please fix it?

Thanks

Unfortunately I have no server with this configuration available to reproduce the problem. Are you sure that you do not have modules like Google Page Speed / SPDY activated? These do the minimization and compression automatically.

Share this post


Link to post
Share on other sites

EDIT: Yay, everything is fine ... turns out, as you can see I forgot the ; at the end of the lines ... stylus habit;

Hi,

I was just trying getting some .less files compiled but something doesn't work with @import.

I have an index.less file which shall import several sub-stylessheets - and that index.less is the only one given to the ::CSS() function:

@import "variables.less"
@import "layout/index.less"
@import "boxes/index.less"

but that just gives me:

#_____LESS_____ERROR_____REPORT_____ {content:"ParseError: Unexpected input in anonymous-file-0.less on line 7, column 1
05| @sth: #ffffff;
06| 
07| @import "/dev/site/templates/styles.less/variables"  // global variables
08| @import "/dev/site/templates/styles.less/layout/index.less"
09| @import "/dev/site/templates/styles.less/boxes/index.less"
10| "}

Am I doing something wrong or is this feature missing in AIOM?

Share this post


Link to post
Share on other sites

I would like to implement your module in my template engine. Unfortunately it doesn't allow paths outside of the template folder. Would be a big enhancement to accept and find the following. I couldn't get it work.

$styles = array();
// relative to the root paths like
$styles[] = '/site/modules/whatever/style.css';
$styles[] = '/wire/templates-admin/styles/font-awesome/css/font-awesome.min.css'; // I use this very often

// absolute paths
$styles[] = 'http://example.org/stylesheet.css';

$urls = AIOM::CSS($styles);
$output = "<link rel=\"stylesheet\" href=\"$urls\">\n";

Herewith I put this on the wishlist! :)  Maybe somebody else would like this too ???

The Option 'Allow directory traversal' doesn't really exist. It expects each stylesheet path relative to the templates folder if I understand the following codelines correctly.

        // ------------------------------------------------------------------------
        // Filter Directory Traversal (default: yes)
        // ------------------------------------------------------------------------
        $_path  = (self::$directoryTraversal !== true) ? str_ireplace(array('../', './', '%2e%2e%2f', '..%2F'), '', wire('config')->paths->templates.$_file) : wire('config')->paths->templates.$_file;

Maybe i missed something and you could help. Anyway a great module you made. Thanks for this.
 

Edited by kixe

Share this post


Link to post
Share on other sites

Just tried it. Just enable directory traversal in AIOM's module config and then use this path

$styles[] = '../../wire/templates-admin/styles/font-awesome/css/font-awesome.min.css';
  • Like 2

Share this post


Link to post
Share on other sites

I forked the module on github which allows the following paths for example:
styles/style.css (relative to template - default)
/site/folder/style.css (relative to root - NEW)
https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js (absolute path to external source via http request -NEW)

https://github.com/kixe/ProcessWire-AIOM-All-In-One-Minify

 

  • Like 3

Share this post


Link to post
Share on other sites

Sounds good thanks for sharing :)

Share this post


Link to post
Share on other sites

I forked the module on github which allows the following paths for example:

May I ask why it is a good idea to fork it, instead of including these features in the original module? Am I missing something perhaps? I'm not a GitHub guru, so I ask: doesn't it mean that these are two completely separate projects from now on?

Share this post


Link to post
Share on other sites

May I ask why it is a good idea to fork it, instead of including these features in the original module? Am I missing something perhaps? I'm not a GitHub guru, so I ask: doesn't it mean that these are two completely separate projects from now on?

I would say because kixe is not the author so he can't just implement those features in the official release, but if needed before the author can implement or pull a request he can just fork to make his own version  ;)

  • Like 3

Share this post


Link to post
Share on other sites

Unfortunately I have no server with this configuration available to reproduce the problem. Are you sure that you do not have modules like Google Page Speed / SPDY activated? These do the minimization and compression automatically.

It has nothing to do with the HTTP2 server. Just some css / js files are getting the same filename.

Share this post


Link to post
Share on other sites

Unfortunately I have no server with this configuration available to reproduce the problem. Are you sure that you do not have modules like Google Page Speed / SPDY activated? These do the minimization and compression automatically.

Should I replace the _getCacheName function with the one from here?

Share this post


Link to post
Share on other sites

May I ask why it is a good idea to fork it, instead of including these features in the original module? Am I missing something perhaps? I'm not a GitHub guru, so I ask: doesn't it mean that these are two completely separate projects from now on?

From the PW modules directory you will get always the original version. If the Author like this feature, he has the freedom to include it. I had to make these changes, to get it working properly with my template function library and I want to share this enhancement. Use it if you like it. :)

  • Like 1

Share this post


Link to post
Share on other sites

May I ask why it is a good idea to fork it, instead of including these features in the original module?

To sum up: this is the standard (github) way of contributing to other's repo.

Share this post


Link to post
Share on other sites

From the PW modules directory you will get always the original version. If the Author like this feature, he has the freedom to include it. I had to make these changes, to get it working properly with my template function library and I want to share this enhancement. Use it if you like it. :)

Thank you for the answer! Is it also standard not to reflect this in README.md and just copy it over? I mean, how can one tell apart the various forked versions? Just by looking at the "main pages" of the projects, they seem identical to me. Sorry if it happens to be an off-topic GitHub question.

  • Like 1

Share this post


Link to post
Share on other sites

That would be a good practice, but maybe even better having a separate CHANGELOG.md file to log changes. You can also check commit messages to see what has changed, provided that the author included one.

  • Like 2

Share this post


Link to post
Share on other sites

Thank you for the answer! Is it also standard not to reflect this in README.md and just copy it over? I mean, how can one tell apart the various forked versions? Just by looking at the "main pages" of the projects, they seem identical to me. Sorry if it happens to be an off-topic GitHub question.

Check the name of the repository at GitHub. In this case there's this line right below it:

That's a pretty good indication that this particular repository might be a fork :)

In the GitHub workflow if you fork another repository you can send a pull request containing all your changes to the original repository / author. If you've changed the README in the fork, those changes will also be included in the PR. That's one reason not to include indication about this being a fork or anything like that.

Of course you can get over this limitation by creating a separate branch for the changes intended for the PR, but that's extra work and most developers are just plain lazy :)

  • Like 4

Share this post


Link to post
Share on other sites

Thanks for educating me, teppo! I have never used GitHub (apart from downloading ZIP files and simple browsing) nor noticed the "forked from" line. Sooner or later I need to find the time to familiarize myself with GitHub, I suppose. And again, sorry for the off-topic question.

  • Like 3

Share this post


Link to post
Share on other sites

@kixe: Thanks! This can be quite useful sometimes. I have never noticed this list before.

Share this post


Link to post
Share on other sites

A feature request: Sass support (specifically SCSS). Thanks! :)

  • Like 3

Share this post


Link to post
Share on other sites

How about adding media query grouping like http://stackoverflow.com/a/18191985/3484824?

I've test implemented it at line 621 or maybe more accurately right before the "Write the minimized file to the file system" comment

// search media query in CSS
preg_match_all('#@media(.*?)\{(.+?}[ \n])\}#si',$_css,$match,PREG_SET_ORDER);//$MatchingString now hold all strings matching $pattern.

$media = array();

// group same media query
foreach ($match as $val)
{
    if (!isset($media[$val[1]])) $media[$val[1]] = '';

    $media[$val[1]] .= $val[2];
}

// delete media query of cache
$_css = preg_replace('#@media(.*?)\{(.+?}[ \n])\}#si', '', $_css);

// add groups of media query at the end of CSS
$final = $_css . "\n";
foreach ($media as $id => $val)
{
    $final .= "\n" . '@media' . $id . '{' . $val . '}' . "\n";
}
$_css = $final;

// ------------------------------------------------------------------------
// Write the minimized file to the file system.
// ------------------------------------------------------------------------

One optimization could be sort ordering of grouped media queries like min-width40em before min-width50em and so on..

OR

# Recursively descend and match all `{ .. }` blocks.
preg_match_all('#(?<media>(?:@media[^{]+)?){(??:[^{}]+)|(?R))*}#s', $_css, $captures);
# Loop through all matches by key.
foreach (array_keys($captures[0]) as $key) {
  # If the value does not contain a @media query, drop it from the array. Or
  # even if we found a @media query, make sure it was not within a string or
  # a comment.
  if (strpos($captures[0][$key], '@media') === FALSE || empty ($captures['media'][$key])) {
    unset ($captures[0][$key]);
  }
}
# Erase all @media queries from the input CSS.
foreach ($captures[0] as $query) {
  $_css = preg_replace('#\s*' . preg_quote($query, '#') . '#u', '', $_css);
}
# Utility function to create an array key from a media query.
function sanitize_media_query_for_key($query) {
  $key = trim($query);
  $key = preg_replace('#[^\w\d]+#u', '-', $key);
  $key = trim($key, '-');
  return $key;
}
# For each @media query, group CSS code together.
$groups = array();
foreach (array_keys($captures[0]) as $key) {
  $media = $captures['media'][$key];
  # The code for this block starts off with the @media query in it...
  $code  = $captures[0][$key];
  # ...which then gets stripped off...
  $code  = preg_replace('#' . preg_quote($media, '#') . '#u', '', $code);
  # ...and any leading or trailing curly bracket also gets removed.
  $code  = preg_replace('#^{|}$#u', '', $code);
  # If this is the first time the @media query is encountered, a new group is
  # created.
  $group_key = sanitize_media_query_for_key($media);
  array_key_exists($group_key, $groups) OR ($groups[$group_key] = array($media, '{'));
  $groups[$group_key][] = $code;
}
$result = NULL;
# Output is the input stripped of any @media queries...
$result = $result . rtrim($_css);
# ...followed by those @media queries grouped together.
foreach (array_keys($groups) as $key) {
  $result = $result . PHP_EOL . PHP_EOL . implode(NULL, $groups[$key]) . '}';
}
$_css = $result;

from https://gist.github.com/StanAngeloff/3164569

but still sorting the result could be interesting(?) Couldn't figure it out myself so far..but it's late..

Edited by Can

Share this post


Link to post
Share on other sites

i've just created a pull request that makes it possible to modify less variables. it also adds a check if the js/css file exists and throws a note either in console if tracy is installed or in the processwire log.

that's how you can modify your less variables:

<?php
$config->styles->append('less/theme.less');
$lessVars = array(
    'tm-primary-bg' => '#568AEA',
    'background-image' => 'url("' . $page->backgroundimage->url . '")',
);
?>
<link rel="stylesheet" href="<?php echo AIOM::CSS($config->styles->unique(), $lessVars); ?>">

https://github.com/FlipZoomMedia/ProcessWire-AIOM-All-In-One-Minify/pull/57

  • Like 3

Share this post


Link to post
Share on other sites

I've installed the module and it works fine.

But:

When I set Development Mode to "yes" the files get combined. Is there a way to disable this? I cannot track the root css files this way...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By teppo
      Needed a really simple solution to embed audio files within page content and couldn't find a module for that, so here we go. Textformatter Audio Embed works a bit like Textformatter Video Embed, converting this:
      <p>https://www.domain.tld/path/to/file.mp3</p> Into this:
      <audio controls class="TextformatterAudioEmbed"> <source src="https://www.domain.tld/path/to/file.mp3" type="audio/mpeg"> </audio> The audio element has pretty good browser support, so quite often this should be enough to get things rolling 🙂
      GitHub repository: https://github.com/teppokoivula/TextformatterAudioEmbed Modules directory: https://modules.processwire.com/modules/textformatter-audio-embed/
    • By Richard Jedlička
      Tense    
      Tense (Test ENvironment Setup & Execution) is a command-line tool to easily run tests agains multiple versions of ProcessWire CMF.
      Are you building a module, or a template and you need to make sure it works in all supported ProcessWire versions? Then Tense is exactly what you need. Write the tests in any testing framework, tell Tense which ProcessWire versions you are interested in and it will do the rest for you.

      See example or see usage in a real project.
      How to use?
      1. Install it: 
      composer global require uiii/tense 2. Create tense.yml config:
      tense init 3. Run it:
      tense run  
      For detailed instructions see Github page: https://github.com/uiii/tense
       
      This is made possible thanks to the great wireshell tool by @justb3a, @marcus and others.
       
      What do you think about it? Do you find it useful? Do you have some idea? Did you find some bug? Tell me you opinion. Write it here or in the issue tracker.
    • By Chris Bennett
      Hi all, I am going round and round in circles and would greatly appreciate if anyone can point me in the right direction.
      I am sure I am doing something dumb, or missing something I should know, but don't. Story of my life 😉

      Playing round with a module and my basic problem is I want to upload an image and also use InputfieldMarkup and other Inputfields.
      Going back and forth between trying an api generated page defining Fieldgroup, Template, Fields, Page and the InputfieldWrapper method.

      InputfieldWrapper method works great for all the markup stuff, but I just can't wrap my head around what I need to do to save the image to the database.
      Can generate a Field for it (thanks to the api investigations) but not sure what I need to do to link the Inputfield to that. Tried a lot of stuff from various threads, of varying dates without luck.
      Undoubtedly not helped by me not knowing enough.

      Defining Fieldgroup etc through the api seems nice and clean and works great for the images but I can't wrap my head around how/if I can add/append/hook the InputfieldWrapper/InputfieldMarkup stuff I'd like to include on that template as well. Not even sure if it should be where it is on ___install with the Fieldtype stuff or later on . Not getting Tracy errors, just nothing seems to happen.
      If anyone has any ideas or can point me in the right direction, that would be great because at the moment I am stumbling round in the dark.
       
      public function ___install() { parent::___install(); $page = $this->pages->get('name='.self::PAGE_NAME); if (!$page->id) { // Create fieldgroup, template, fields and page // Create new fieldgroup $fmFieldgroup = new Fieldgroup(); $fmFieldgroup->name = MODULE_NAME.'-fieldgroup'; $fmFieldgroup->add($this->fields->get('title')); // needed title field $fmFieldgroup->save(); // Create new template using the fieldgroup $fmTemplate = new Template(); $fmTemplate->name = MODULE_NAME; $fmTemplate->fieldgroup = $fmFieldgroup; $fmTemplate->noSettings = 1; $fmTemplate->noChildren = 1; $fmTemplate->allowNewPages = 0; $fmTemplate->tabContent = MODULE_NAME; $fmTemplate->noChangeTemplate = 1; $fmTemplate->setIcon(ICON); $fmTemplate->save(); // Favicon source $fmField = new Field(); $fmField->type = $this->modules->get("FieldtypeImage"); $fmField->name = 'fmFavicon'; $fmField->label = 'Favicon'; $fmField->focusMode = 'off'; $fmField->gridMode = 'grid'; $fmField->extensions = 'svg png'; $fmField->columnWidth = 50; $fmField->collapsed = Inputfield::collapsedNever; $fmField->setIcon(ICON); $fmField->addTag(MODULE_NAME); $fmField->save(); $fmFieldgroup->add($fmField); // Favicon Silhouette source $fmField = new Field(); $fmField->type = $this->modules->get("FieldtypeImage"); $fmField->name = 'fmFaviconSilhouette'; $fmField->label = 'SVG Silhouette'; $fmField->notes = 'When creating a silhouette/mask svg version for Safari Pinned Tabs and Windows Tiles, we recommend setting your viewbox for 0 0 16 16, as this is what Apple requires. In many cases, the easiest way to do this in something like illustrator is a sacrificial rectangle with no fill, and no stroke at 16 x 16. This forces the desired viewbox and can then be discarded easily using something as simple as notepad. Easy is good, especially when you get the result you want without a lot of hassle.'; $fmField->focusMode = 'off'; $fmField->extensions = 'svg'; $fmField->columnWidth = 50; $fmField->collapsed = Inputfield::collapsedNever; $fmField->setIcon(ICON); $fmField->addTag(MODULE_NAME); $fmField->save(); $fmFieldgroup->add($fmField); // Create: Open Settings Tab $tabOpener = new Field(); $tabOpener->type = new FieldtypeFieldsetTabOpen(); $tabOpener->name = 'fmTab1'; $tabOpener->label = "Favicon Settings"; $tabOpener->collapsed = Inputfield::collapsedNever; $tabOpener->addTag(MODULE_NAME); $tabOpener->save(); // Create: Close Settings Tab $tabCloser = new Field(); $tabCloser->type = new FieldtypeFieldsetClose; $tabCloser->name = 'fmTab1' . FieldtypeFieldsetTabOpen::fieldsetCloseIdentifier; $tabCloser->label = "Close open tab"; $tabCloser->addTag(MODULE_NAME); $tabCloser->save(); // Create: Opens wrapper for Favicon Folder Name $filesOpener = new Field(); $filesOpener->type = new FieldtypeFieldsetOpen(); $filesOpener->name = 'fmOpenFolderName'; $filesOpener->label = 'Wrap Folder Name'; $filesOpener->class = 'inline'; $filesOpener->collapsed = Inputfield::collapsedNever; $filesOpener->addTag(MODULE_NAME); $filesOpener->save(); // Create: Close wrapper for Favicon Folder Name $filesCloser = new Field(); $filesCloser->type = new FieldtypeFieldsetClose(); $filesCloser->name = 'fmOpenFolderName' . FieldtypeFieldsetOpen::fieldsetCloseIdentifier; $filesCloser->label = "Close open fieldset"; $filesCloser->addTag(MODULE_NAME); $filesCloser->save(); // Create Favicon Folder Name $fmField = new Field(); $fmField->type = $this->modules->get("FieldtypeText"); $fmField->name = 'folderName'; $fmField->label = 'Favicon Folder:'; $fmField->description = $this->config->urls->files; $fmField->placeholder = 'Destination Folder for your generated favicons, webmanifest and browserconfig'; $fmField->columnWidth = 100; $fmField->collapsed = Inputfield::collapsedNever; $fmField->setIcon('folder'); $fmField->addTag(MODULE_NAME); $fmField->save(); $fmFieldgroup->add($tabOpener); $fmFieldgroup->add($filesOpener); $fmFieldgroup->add($fmField); $fmFieldgroup->add($filesCloser); $fmFieldgroup->add($tabCloser); $fmFieldgroup->save(); /////////////////////////////////////////////////////////////// // Experimental Markup Tests $wrapperFaviconMagic = new InputfieldWrapper(); $wrapperFaviconMagic->attr('id','faviconMagicWrapper'); $wrapperFaviconMagic->attr('title',$this->_('Favicon Magic')); // field show info what $field = $this->modules->get('InputfieldMarkup'); $field->name = 'use'; $field->label = __('How do I use it?'); $field->collapsed = Inputfield::collapsedNever; $field->icon('info'); $field->attr('value', 'Does this even begin to vaguely work?'); $field->columnWidth = 50; $wrapperFaviconMagic->add($field); $fmTemplate->fields->add($wrapperFaviconMagic); $fmTemplate->fields->save(); ///////////////////////////////////////////////////////////// // Create page $page = $this->wire( new Page() ); $page->template = MODULE_NAME; $page->parent = $this->wire('pages')->get('/'); $page->addStatus(Page::statusHidden); $page->title = 'Favicons'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } }  
    • By Sebi
      Since it's featured in ProcessWire Weekly #310, now is the time to make it official:
      Here is Twack!
      I really like the following introduction from ProcessWire Weekly, so I hope it is ok if I use it here, too. Look at the project's README for more details!
      Twack is a new — or rather newish — third party module for ProcessWire that provides support for reusable components in an Angular-inspired way. Twack is implemented as an installable module, and a collection of helper and base classes. Key concepts introduced by this module are:
      Components, which have separate views and controllers. Views are simple PHP files that handle the output for the component, whereas controllers extend the TwackComponent base class and provide additional data handling capabilities. Services, which are singletons that provide a shared service where components can request data. The README for Twack uses a NewsService, which returns data related to news items, as an example of a service. Twack components are designed for reusability and encapsulating a set of features for easy maintainability, can handle hierarchical or recursive use (child components), and are simple to integrate with an existing site — even when said site wasn't originally developed with Twack.
      A very basic Twack component view could look something like this:
      <?php namespace ProcessWire; ?> <h1>Hello World!</h1> And here's how you could render it via the API:
      <?php namespace Processwire; $twack = $modules->get('Twack'); $hello = $twack->getNewComponent('HelloWorld'); ?> <html> <head> <title>Hello World</title> </head> <body> <?= $hello->render() ?> </body> </html> Now, just to add a bit more context, here's a simple component controller:
      <?php namespace ProcessWire; class HelloWorld extends TwackComponent { public function __construct($args) { parent::__construct($args); $this->title = 'Hello World!'; if(isset($args['title'])) { $this->title = $args['title']; } } } As you can see, there's not a whole lot new stuff to learn here if you'd like to give Twack a try in one of your projects. The Twack README provides a really informative and easy to follow introduction to all the key concepts (as well as some additional examples) so be sure to check that out before getting started. 
      Twack is in development for several years and I use it for every new project I build. Also integrated is an easy to handle workflow to make outputs as JSON, so it can be used to build responses for a REST-api as well. I will work that out in one section in the readme as well. 
      If you want to see the module in an actual project, I have published the code of www.musical-fabrik.de in a repository. It runs completely with Twack and has an app-endpoint with ajax-output as well.
      I really look forward to hear, what you think of Twack🥳!
      Features Installation Usage Quickstart: Creating a component Naming conventions & component variants Component Parameters directory page parameters viewname Asset handling Services Named components Global components Ajax-Output Configuration Versioning License Changelog
    • By Robin S
      Page Reference Default Value
      Most ProcessWire core inputfield types that can be used with a Page Reference field support a "Default value" setting. This module extends support for default values to the following core inputfield types:
      Page List Select Page List Select Multiple Page Autocomplete (single and multiple) Seeing as these inputfield types only support the selection of pages a Page List Select / Page List Select Multiple is used for defining the default value instead of the Text / Textarea field used by the core for other inputfield types. This makes defining a default value a bit more user-friendly.
      Note that as per the core "Default value" setting, the Page Reference field must be set to "required" in order for the default value to be used.
      Screenshot

       
      https://github.com/Toutouwai/PageReferenceDefaultValue
      https://modules.processwire.com/modules/page-reference-default-value/
×
×
  • Create New...