Jump to content

Recommended Posts

Obviously ImageMagick causes this bug in combination with uploading JPG files, according to the AJAX error message. After deinstalling the IMagick Image Sizer module, uploading JPGs is no problem.

This was my test case:

  1. Uploading the PNG file testupload1png.png
    • With ImageMagick: upload works 👍🏻
    • Without ImageMagick: upload works 👍🏻
  2. Uploading the same image as above converted into the JPG file testupload1jpg.jpg
    • With ImageMagick: upload results in an error message and doesn’t show up in Media Manager. 👎🏻
      AJAX error message: “no decode delegate for this image format `JPEG' @ error/constitute.c/ReadImage/504”
    • Without ImageMagick: upload works 👍🏻
  3. Uploading a second PMG file testupload2png.png
    • With ImageMagick: upload works 👍🏻 AND somehow “pushes” the failed JPG upload into the Media Manager, so now all three uploaded files show up as they should.
    • Without ImageMagick: upload works 👍🏻

I guess I can now either not use ImageMagick (which I just used because my hoster provides it on their servers as a default and it was recommended because of better memory usage). Or I can ask the support of my hoster about this problem.

Share this post


Link to post
Share on other sites

Aah, we've got it nailed down at last! The issue, as per the error message and a bit of Googling, is an ImageMagick bug/issue. There are several solutions out there. ImageMagick is a very good library. Before giving up on it, ask your hoster (if you don't have access yourself) to resolve the issue given that there are several solutions out there. Some resolutions simply involve recompiling the library. Here are a few examples of the 'bug':

  1. https://stackoverflow.com/questions/9586048/imagemagick-no-decode-delegate
  2. https://www.imagemagick.org/discourse-server/viewtopic.php?t=12366
  3. https://stackoverflow.com/questions/37594157/imagemagick-no-decode-delegate-for-this-image-format-error-constitute-c-re
  4. http://www.imagemagick.org/discourse-server/viewtopic.php?t=32287

Share this post


Link to post
Share on other sites

This module looks great. I need to upload 300 audio files and it looks this module can do the job.

Is it possible to only show 'Audio' and hide tabs like 'Documents' and 'Images'?

 

Share this post


Link to post
Share on other sites
14 hours ago, tooth-paste said:

Is it possible to only show 'Audio' and hide tabs like 'Documents' and 'Images'?

Yes. However, in the current version, this only works from the inputfield/fieldtype side of things, i.e. when adding media (in media manager library) to a media manager field on a page. When accessing the media library directly, one sees all the 4 media types. However, on the dev version that I'm still working on (it has taken a while I know, but I'd rather get it right than hurry it through since it is a major release), one can control the 'global' visibility of media types as well as at the inputfield/fieldtype level. I'm not sure when the dev version will be ready though. I thought it would have been ready by now but that didn't happen, so, no more ETAs I'm afraid. 

Share this post


Link to post
Share on other sites

I'am having some problems to output audio(mp3) files. I've installed Media Manager but don't 'get' it quit yet. The media manager is working and I can upload files.

My template is called 'prekenarchief' and placed the code from the documentation:

  

$media = $page->media;// returns a MediaManagerArray. Needs to be looped through

foreach ($media as $m) {
    echo $m->id;// e.g. 1234 (hidden page in /admin/media-manager/media-parent/)
    echo $m->type;// e.g. 3 (a media of type image) OR 1 (a media of type audio)
    echo $m->typeLabel;// e.g. 'document' (i.e. type would be 2)
    echo $m->title;// e.g. 'My Nice Trip' (whose media file could be my-nice-trip.mp4)
    /*
        @note: 
        - $m->media returns an object;
                   either a ProcessWire Image (for image media) or File object (for audio, document and video media)
        - This means you have access to all the properties of that object,
                   e.g. ext, tags, description, url, filename, basename, width, height,
                        modified, created, filesize, filesizeStr, etc
                        as well as associated methods, e.g. size()
    */ 
    
    echo $m->media->tags;
}

// only output images
foreach ($media as $m) {
    if($m->typeLabel =='image') {
        echo "<img src='" . $m->media->size(100,75)->url . "'><br>";
    }
    
}

// There's also a toString() method so you can do:
echo $page->media;

 

1. What do I need to add to the template to get it to work? I added a new field to the template called 'media', but it doesn't work.

2. Do I need to alter the example code above. For example: Do I need to place an ID. 

 

 

Share this post


Link to post
Share on other sites
On 6/26/2018 at 3:35 PM, tooth-paste said:

The media manager is working and I can upload files.

Thanks for the purchase 🙂.

On 6/26/2018 at 3:35 PM, tooth-paste said:

I'am having some problems to output audio(mp3) files.

 

On 6/26/2018 at 3:35 PM, tooth-paste said:

1. What do I need to add to the template to get it to work? I added a new field to the template called 'media', but it doesn't work.

Is media a Media Manager field? If it is not, you need to first create and add a Media Manager field to your  prekenarchief template. You will then need to add the audio files you want to that field. There will be a link in the Media Manager inputfield to your Media Library. You can then use the code above.  This is the most common scenario/usage of Media Manager. You upload media to your Media Manager Library first. You then pick and choose the ones you want to add to a certain page. Finally, you access them using Media Manager API.

Alternatively, you can directly access the media in the Media Library from within your template file without first having to add them to a Media Manager field, e.g.:

/* @note:
  the Media Manager template for audio media is 'media-manager-audio'
  the field with the audio media is 'media_manager_audio'
  in this case, we use include=all OR check_access = 0 since media pages are access-controlled
  admin pages
*/
$media = $pages->find('template=media-manager-audio, include=all, limit=10');
// $media is a PageArray
foreach ($media as $m) {
   // media_manager_image is a Pagefiles so we need to loop through it but..
   // media_manager_audio (also document and video) is a Pagefile. No need to loop
   // example for image media (template = media-manager-image)
   //foreach ($m->media_manager_image as $image) echo $image->url;
   // example for audio/document/video media
   echo $m->media_manager_audio->url;
} 

This is not a common usage, but choose what fits your workflow best.

Edited by kongondo
Code correction

Share this post


Link to post
Share on other sites

Thanks for your reply. Something is still not right. Could you check these settings?

I've created a field 'media' and added it to my template.

2085866872_Schermafbeelding2018-06-27om09_01_32.png.5a4fb521901beea9dddb2f3c4bf5ec42.png

 

When I try to add files the 'Insert media' button does not work. I have added files thru upload.

2010269875_Schermafbeelding2018-06-27om09_02_05.thumb.png.5ccfa46bd08c59429d807bce65950814.png

 

 

My template looks like this. But it brings no output to the front-end. Am I doing something wrong?

<?php include("./header.php"); ?>

<div class="container paddingbottom3 paddingtop2">
	<div class="row">
		<div class="col-md-12">
			<div class="row">
				<div class="col-md-6 bglichtgrijs link paddingbottom3">
					<div class="paddingleft4 paddingright5">
						<div class="paddingleft4">
							<h2>Preken</h2>
							
							<?php

								$media = $pages->find('template=media-manager-audio, include=all, limit=10');
								// $media is a PageArray
								foreach ($media as $m) {
								   // media_manager_image is a Pagefiles
									foreach ($m->media_manager_audio as $audio) echo $audio->url;
								}				
							?>
							
						</div>
					</div>
				</div>
				<div class="col-md-6 bggeel link paddingtop2 paddingbottom2">
					<h2 class="colorwit"><?php echo $page->title; ?></h2>
					<br /><br />
					<span class="glyphicon glyphicon-arrow-right colorwit paddingright5"></span><a href="/contact">Neem contact op</a>
				</div>
				
			</div>
		</div>
	</div>
</div>


<?php include("./footer.php"); ?>

 

 

Share this post


Link to post
Share on other sites
On 6/27/2018 at 8:08 AM, tooth-paste said:

When I try to add files the 'Insert media' button does not work.

I can tell from your screen grab that the audio media 2212 is unpublished (the crossed eye icon). Unpublished media cannot be added to a Media Manager field, hence why insert media button doesn't do anything. In the upcoming version of MM, you will get a meaningful message/error if you try to add unpublished media to an MM field.

 

On 6/27/2018 at 8:08 AM, tooth-paste said:

My template looks like this. But it brings no output to the front-end. Am I doing something wrong?

Oops, my bad, sorry. Image media would have returned a Pagefiles but audio media should return a Pagefile. So, no need for inner foreach.

$media = $pages->find('template=media-manager-audio, include=all, limit=10');
// $media is a PageArray
foreach ($media as $m) {
	// media_manager_image is a Pagefiles but media_manager_audio is a Pagefile
	// so, no need to loop
	echo $m->media_manager_audio->url;// url to your audio media
}

Just a reminder that the above code is for Direct Access. Use it only if you want to access your media directly from your Media Library without having to add them to any page (i.e., to any MM field). In this case, you do not need the MM media field in your prekenarchief template.

Alternatively, to interact with a MM field, use the code in the documentation.

Edited by kongondo
Code correction

Share this post


Link to post
Share on other sites

@tooth-paste, please note the corrected code in my last post, i.e.

 

11 minutes ago, kongondo said:

echo $m->media_manager_audio->url;// url to your audio media

 

Edited by kongondo

Share this post


Link to post
Share on other sites

Hi,

Some time, without a reason, the modulo deletes the images. Do you know why?

I notice when a user enters these pages and in the backend appears the 404 error, I go to see and in fact the images inside the media manager are gone.

Someone knows why and what can I do?

--

Sorry @kongondo!!!! I'm really sorry  I got confused with Media Library module!!! 😨😓 

Edited by MarcoPLY

Share this post


Link to post
Share on other sites
4 hours ago, MarcoPLY said:

Some time, without a reason, the modulo deletes the images. Do you know why?

Hi @MarcoPLY,

Please confirm you are talking about the commercial Media Manager module and not another module. Media Manager does not randomly delete images 🙂. I seem to recall you were using other modules for your media needs?

 

  • Sad 1

Share this post


Link to post
Share on other sites

Hi kongondo,

we've bought Media Manager under ageny licence and we and our clients are happy with it. But there is actually a problem on a certain page: The integrated upload function no longer works with following exception (from log):

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'heikotel-hotel-am-stadtpark-buffet-2-9840a-1032' for key 'name_parent_id' (in /wire/core/WireDatabasePDO.php line 454) 

How can we fix this?

Another small question: Is there any possibility to get the real url to any media manager document directly from backend? I know how to render the url in my code (by $m->media->url), but some clients want to copy the url from media manager backend into other targets, but didn't found it (and me too). The url can be assembled by analyzing the source code, but this in no option for clients.

Thank you and Best regards,

Thomas.

Share this post


Link to post
Share on other sites

@Thomas Scholz,

Welcome to the forums.

11 hours ago, Thomas Scholz said:

we've bought Media Manager under ageny licence and we and our clients are happy with it.

Thanks for the purchase.

11 hours ago, Thomas Scholz said:

But there is actually a problem on a certain page: The integrated upload function no longer works with following exception (from log):

Media are saved as pages, hidden away under Admin. It seems a situation occurred whereby the creation of a media page did not complete and subsequently, the media was re-uploaded and the module tried to create the page again. Since in PW, no pages under the same parent cannot share a name, you get the violation constraint. Was this a media with a big image you were trying to upload? Try deleting the page physically in your page tree: admin > media-manager > media-manager-image > heikohotel-hotel-am-stadtpark-buffet-2-9840a-1032. Make sure to delete it and also empty the trash. If not, you might have to physically delete the page entry in your DB. This situation has happened to me once or twice in the past. I know it is annoying, apologies. On a related note, Media Manager has a setting for handling duplicate media. I'm not sure why that did not kick in before your situation occurred. Most likely, like I said, a page creation did not complete. Let me know if you are still not able to resolve this and I can have a look if the site is online.

 

11 hours ago, Thomas Scholz said:

but some clients want to copy the url from media manager backend into other targets,

I am not sure I understand this. Do you mean, they want to link to media, for example, within text in CKEditor (either as an image or link)? If the answer is yes, just click on the image or link icons in CKEditor and you will see links to pick the media from Media Manager.

Share this post


Link to post
Share on other sites

Thank you for your quick answers!

For the first point, the deletion of the concerning page was successful, but was followed by the next similar error with another media page. I will keep trying.

For the second point, the client doesn't need the link in CKEditor, but in Redirects module to set a shorter url for certain pdf documents. So I cant't explain him, how to obtain the original url/path from Media Manager to set as "redirect to".

Share this post


Link to post
Share on other sites
29 minutes ago, Thomas Scholz said:

but was followed by the next similar error with another media page. I will keep trying.

Hmm. That's not ideal. This is not how MM usually works 🙂. What's your server environment? ProcessWire version?

30 minutes ago, Thomas Scholz said:

but in Redirects module to set a shorter url for certain pdf documents. So I cant't explain him, how to obtain the original url/path from Media Manager to set as "redirect to".

I have never used the Redirect module. Could you please show me a screenshot of the input where the URL is supposed to go? Do you need the URL or the path?

Share this post


Link to post
Share on other sites

For Redirect module, we need the path, e.g. site/assets/files/1234/foo.pdf. This info I can take from source code view or browser dev tools, but for a non-programming-oriented editor ther is no chance to take it directly from Media Manager backend. I would prefer an additional line in document detail view containig the path or url (see attachment).

 

Media Manager Document Detail View Proposal.png

Share this post


Link to post
Share on other sites
5 hours ago, Thomas Scholz said:

I would prefer an additional line in document detail view containig the path or url (see attachment)

Excellent idea! I'll add it in the next version of MM. Meanwhile, for now, you can edit the file MediaManagerRender.php and enter the following code after the Filename, i.e. on line #676:

'<span>' . $this->_('URL') . ':</span> ' . $m->httpUrl . '<br>' .

Please note, the output (URL) might be quite long, so the CSS could be off. However, I cannot work on this now since the new version of MM will have a different layout. It will present a challenge though since the descriptions, etc are viewable on hover. When the house is moved away, the overlay goes. This means, it will not be possible to copy the URL. I hope this makes sense. I will have to think more about this.

Share this post


Link to post
Share on other sites

We've been working on adding the media manger to our new project, but when we create a field to add images/videos to the page, we get the following error in Media Manager:

{"error":true,"message":"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cmsdev01.field_Product_Assets' doesn't exist"}

When we remove the field from the template (actually we have to delete the field entirely) then the Media Manger will load again and not display that error.  Is there something additional we need to do when we want to start adding Media Manager fields to pages?

Share this post


Link to post
Share on other sites

Hi @Karinne Cyphers,

On 7/27/2018 at 1:34 AM, Karinne Cyphers said:

{"error":true,"message":"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cmsdev01.field_Product_Assets' doesn't exist"}

When we remove the field from the template (actually we have to delete the field entirely) then the Media Manger will load again and not display that error.  Is there something additional we need to do when we want to start adding Media Manager fields to pages?

I don't remember ever seeing this error in respect of Media Manager. A couple of questions:

  1. Do other fields, either in the same template or a different one work OK? For instance, text fields, etc
  2. Is the problem with this one template or have you tried a different template?
  3. Maybe there is an issue with the name of your field. Try renaming it to something else and use lower case letters only
  4. MySQL and PHP versions?

If possible, please post a screenshot or animated gif of the error, thanks.

Share this post


Link to post
Share on other sites

Thank you for replying... we've identified the issue occurs when we create a Media Manager field with mixed case.  When we create a field that is all lower case the error does not occur and the media manager functions normally.  Everything about the templates function normally, and we can make the media manager field function correctly f it is all lower case.   We've tried different templates and repeaters and the issue always occurs if the field is mixed case.  Our environment is running PHP 7.1.17 and MariaDB 5.6.10.  We had been using mixed case fields as it made it easier to read.  The error occurs whether or not the Manager Manager field has been added to a template or not.

I'm attaching a couple screenshots.  Thank you!

Sketch.png

Sketch (1).png

  • Like 1

Share this post


Link to post
Share on other sites

@Karinne Cyphers,

Thanks for the screenshots. They've helped clarify issues.

24 minutes ago, Karinne Cyphers said:

we've identified the issue occurs when we create a Media Manager field with mixed case

I suspected as much given the error MySQL was throwing.

The error itself is originating from  ProcessPageLister (a core module) which Media Manager extends and uses to fetch and display media pages. As far as I can remember, ProcessWire only allows lower case letters for field names. Going by your screenshot though, it seems this changed sometime back. 

Back to your issue, the error is a ProcessWire error and not Media Manager's.  I'm not sure whether it should be filed as a ProcessWire bug (specific to your server environment, maybe) since it now seems upper case letters are allowed in field names. I'll try and find out.

 

Edited by kongondo
  • Like 1

Share this post


Link to post
Share on other sites
21 minutes ago, kongondo said:

As far as I can remember, ProcessWire only allows lower case letters for field names.

I think it has always said this:

"Use only ASCII letters (a-z A-Z), numbers (0-9) or underscores."

I think it's likely we've just always assumed lowercase only because names suggest lowercase vs labels/titles which is where you expect difference cases, spaces, special chars etc.

  • Like 1

Share this post


Link to post
Share on other sites
32 minutes ago, adrian said:

I think it has always said this:

"Use only ASCII letters (a-z A-Z), numbers (0-9) or underscores."

I think it's likely we've just always assumed lowercase only because names suggest lowercase vs labels/titles which is where you expect difference cases, spaces, special chars etc.

Thanks Adrian. This got me more curious because I vaguely remember having a talk about lower case vs upper case. So, I went back and checked, all the way from 2.2 up to and including 2.7.3. It was only lower case in those versions. So, this must be a 3.x introduction.

 

  • Like 2

Share this post


Link to post
Share on other sites
3 minutes ago, kongondo said:

Thanks Adrian. This got me more curious because I vaguely remember having a talk about lower case vs upper case. So, I went back and checked, all the way from 2.2 up to and including 2.7.3. It was only lower case in those versions. So, this must be a 3.x introduction.

 

Apologies - you are indeed correct.

I can't imagine why it would actually have been changed - not sure why you'd need uppercase chars in a field name, but the description of what is allowed certainly has changed.

https://github.com/ryancramerdesign/ProcessWire/blob/a210ba0b5ea67e56fef8a27a620bcfa6f96ca0b8/wire/modules/Process/ProcessField/ProcessField.module#L949

https://github.com/processwire/processwire/blob/48fe0769a4eb3d0f5b4732fd01b4b4ed8262d952/wire/modules/Process/ProcessField/ProcessField.module#L1196

  • Like 2

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 David Karich
      ProcessWire InputfieldRepeaterMatrixDuplicate
      Thanks to the great ProModule "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use a content module on a different page (e.g. in the same design), you have to rebuild each item manually every time.
      This module extends the commercial ProModule "RepeaterMatrix" by the function to duplicate repeater items from one page to another page. The condition is that the target field is the same matrix field from which the item is duplicated. This module is currently understood as proof of concept. There are a few limitations that need to be considered. The intention of the module is that this functionality is integrated into the core of RepeaterMatrix and does not require an extra module.
      Check out the screencast
      What the module can do
      Duplicate multible repeater items from one page to another No matter how complex the item is Full support for file and image fields Multilingual support Support of Min and Max settings Live synchronization of clipboard between multiple browser tabs. Copy an item and simply switch the browser tab to the target page and you will immediately see the past button Support of multiple RepeaterMatrix fields on one page Configurable which roles and fields are excluded Configurable dialogs for copy and paste Duplicated items are automatically pasted to the end of the target field and set to hidden status so that changes are not directly published Automatic clipboard update when other items are picked Automatically removes old clipboard data if it is not pasted within 6 hours Delete clipboard itself by clicking the selected item again Benefit: unbelievably fast workflow and content replication What the module can't do
      Before an item can be duplicated in its current version, the source page must be saved. This means that if you make changes to an item and copy this, the old saved state will be duplicated Dynamic loading is currently not possible. Means no AJAX. When pasting, the target page is saved completely No support for nested repeater items. Currently only first level items can be duplicated. Means a repeater field in a repeater field cannot be duplicated. Workaround: simply duplicate the parent item Dynamic reloading and adding of repeater items cannot be registered. Several interfaces and events from the core are missing. The initialization occurs only once after the page load event Changelog
      2.0.0
      Feature: Copy multiple items at once! The fundament for copying multiple items was created by @Autofahrn - THX! Feature: Optionally you can disable the copy and/or paste dialog Bug fix: A fix suggestion when additional and normal repeater fields are present was contributed by @joshua - THX! 1.0.4
      Bug fix: Various bug fixes and improvements in live synchronization Bug fix: Items are no longer inserted when the normal save button is clicked. Only when the past button is explicitly clicked Feature: Support of multiple repeater fields in one page Feature: Support of repeater Min/Max settings Feature: Configurable roles and fields Enhancement: Improved clipboard management Enhancement: Documentation improvement Enhancement: Corrected few typos #1 1.0.3
      Feature: Live synchronization Enhancement: Load the module only in the backend Enhancement: Documentation improvement 1.0.2
      Bug fix: Various bug fixes and improvements in JS functions Enhancement: Documentation improvement Enhancement: Corrected few typos 1.0.1
      Bug fix: Various bug fixes and improvements in the duplication process 1.0.0
      Initial release Support this module
      If this module is useful for you, I am very thankful for your small donation: Donate 5,- Euro (via PayPal – or an amount of your choice. Thank you!)
      Download this module (Version 2.0.0)
      > Github: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate
      > PW module directory: https://modules.processwire.com/modules/inputfield-repeater-matrix-duplicate/
      > Old stable version (1.0.4): https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate/releases/tag/1.0.4
    • By Robin S
      A new module that hasn't had a lot of testing yet. Please do your own testing before deploying on any production website.
      Custom Paths
      Allows any page to have a custom path/URL.
      Note: Custom Paths is incompatible with the core LanguageSupportPageNames module. I have no experience working with LanguageSupportPageNames or multi-language sites in general so I'm not in a position to work out if a fix is possible. If anyone with multi-language experience can contribute a fix it would be much appreciated!
      Screenshot

      Usage
      The module creates a field named custom_path on install. Add the custom_path field to the template of any page you want to set a custom path for. Whatever path is entered into this field determines the path and URL of the page ($page->path and $page->url). Page numbers and URL segments are supported if these are enabled for the template, and previous custom paths are managed by PagePathHistory if that module is installed.
      The custom_path field appears on the Settings tab in Page Edit by default but there is an option in the module configuration to disable this if you want to position the field among the other template fields.
      If the custom_path field is populated for a page it should be a path that is relative to the site root and that starts with a forward slash. The module prevents the same custom path being set for more than one page.
      The custom_path value takes precedence over any ProcessWire path. You can even override the Home page by setting a custom path of "/" for a page.
      It is highly recommended to set access controls on the custom_path field so that only privileged roles can edit it: superuser-only is recommended.
      It is up to the user to set and maintain suitable custom paths for any pages where the module is in use. Make sure your custom paths are compatible with ProcessWire's $config and .htaccess settings, and if you are basing the custom path on the names of parent pages you will probably want to have a strategy for updating custom paths if parent pages are renamed or moved.
      Example hooks to Pages::saveReady
      You might want to use a Pages::saveReady hook to automatically set the custom path for some pages. Below are a couple of examples.
      1. In this example the start of the custom path is fixed but the end of the path will update dynamically according to the name of the page:
      $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); if($page->template == 'my_template') { $page->custom_path = "/some-custom/path-segments/$page->name/"; } }); 2. The Custom Paths module adds a new Page::realPath method/property that can be used to get the "real" ProcessWire path to a page that might have a custom path set. In this example the custom path for news items is derived from the real ProcessWire path but a parent named "news-items" is removed:
      $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); if($page->template == 'news_item') { $page->custom_path = str_replace('/news-items/', '/', $page->realPath); } }); Caveats
      The custom paths will be used automatically for links created in CKEditor fields, but if you have the "link abstraction" option enabled for CKEditor fields (Details > Markup/HTML (Content Type) > HTML Options) then you will see notices from MarkupQA warning you that it is unable to resolve the links.
      Installation
      Install the Custom Paths module.
      Uninstallation
      The custom_path field is not automatically deleted when the module is uninstalled. You can delete it manually if the field is no longer needed.
       
      https://github.com/Toutouwai/CustomPaths
      https://modules.processwire.com/modules/custom-paths/
    • By teppo
      Hey folks!
      I'm happy to finally introduce a project I've been working on for quite a while now: it's called Wireframe, and it is an output framework for ProcessWire.
      Note that I'm posting this in the module development area, maily because this project is still in rather early stage. I've built a couple of sites with it myself, and parts of the codebase have been powering some pretty big and complex sites for many years now, but this should still be considered a soft launch 🙂
      --
      Long story short, Wireframe is a module that provides the "backbone" for building sites (and apps) with ProcessWire using an MVC (or perhaps MVVM... one of those three or four letter acronyms anyway) inspired methodology. You could say that it's an output strategy, but I prefer the term "output framework", since in my mind the word "strategy" means something less tangible. A way of doing things, rather than a tool that actually does things.
      Wireframe (the module) provides a basic implementation for some familiar MVC concepts, such as Controllers and a View layer – the latter of which consists of layouts, partials, and template-specific views. There's no "model" layer, since in this context ProcessWire is the model. As a module Wireframe is actually quite simple – not even nearly the biggest one I've built – but there's still quite a bit of stuff to "get", so I've put together a demo & documentation site for it at https://wireframe-framework.com/.
      In addition to the core module, I'm also working on a couple of site profiles based on it. My current idea is actually to keep the module very light-weight, and implement most of the "opinionated" stuff in site profiles and/or companion modules. For an example MarkupMenu (which I released a while ago) was developed as one of those "companion modules" when I needed a menu module to use on the site profiles.
      Currently there are two public site profiles based on Wireframe:
      site-wireframe-docs is the demo&docs site mentioned above, just with placeholder content replaced with placeholder content. It's not a particularly complex site, but I believe it's still a pretty nice way to dig into the Wireframe module. site-wireframe-boilerplate is a boilerplate (or starter) site profile based on the docs site. This is still very much a work in progress, but essentially I'm trying to build a flexible yet full-featured starter profile you can just grab and start building upon. There will be a proper build process for resources, it will include most of the basic features one tends to need from site to site, etc. --
      Requirements and getting started:
      Wireframe can be installed just like any ProcessWire module. Just clone or download it to your site/modules/ directory and install. It doesn't, though, do a whole lot of stuff on itself – please check out the documentation site for a step-by-step guide on setting up the directory structure, adding the "bootstrap file", etc. You may find it easier to install one of the site profiles mentioned above, but note that this process involves the use of Composer. In the case of the site profiles you can install ProcessWire as usual and download or clone the site profile directory into your setup, but after that you should run "composer install" to get all the dependencies – including the Wireframe module – in place. Hard requirements for Wireframe are ProcessWire 3.0.112 and PHP 7.1+. The codebase is authored with current PHP versions in mind, and while running it on 7.0 may be possible, anything below that definitely won't work. A feature I added just today to the Wireframe module is that in case ProcessWire has write access to your site/templates/ directory, you can use the module settings screen to create the expected directories automatically. Currently that's all, and the module won't – for an example – create Controllers or layouts for you, so you should check out the site profiles for examples on these. (I'm probably going to include some additional helper features in the near future.)
      --
      This project is loosely based on an earlier project called pw-mvc, i.e. the main concepts (such as Controllers and the View layer) are very similar. That being said, Wireframe is a major upgrade in terms of both functionality and architecture: namespaces and autoloader support are now baked in, the codebase requires PHP 7, Controllers are classes extending \Wireframe\Controller (instead of regular "flat" PHP files), implementation based on a module instead of a collection of drop-in files, etc.
      While Wireframe is indeed still in a relatively early stage (0.3.0 was launched today, in case version numbers matter) for the most part I'm happy with the way it works, and likely won't change it too drastically anytime soon – so feel free to give it a try, and if you do, please let me know how it went. I will continue building upon this project, and I am also constantly working on various side projects, such as the site profiles and a few unannounced helper modules.
      I should probably add that while Wireframe is not hard to use, it is more geared towards those interested in "software development" type methodology. With future updates to the module, the site profiles, and the docs I hope to lower the learning curve, but certain level of "developer focus" will remain. Although of course the optimal outcome would be if I could use this project to lure more folks towards that end of the spectrum... 🙂
      --
      Please let me know what you think – and thanks in advance!
    • By tcnet
      PageViewStatistic for ProcessWire is a module to log page visits of the CMS. The records including some basic information like IP-address, browser, operating system, requested page and originate page. Please note that this module doesn't claim to be the best or most accurate.
      Advantages
      One of the biggest advantage is that this module doesn't require any external service like Google Analytics or similar. You don't have to modify your templates either. There is also no JavaScript or image required.
      Disadvantages
      There is only one disadvantage. This module doesn't record visits if the browser loads the page from its browser cache. To prevent the browser from loading the page from its cache, add the following meta tags to the header of your page:
      <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> How to use
      The records can be accessed via the Setup-menu of the CMS backend. The first dropdown control changes the view mode. There are 4 different view modes.
      View mode "Day" shows all visits of the selected day individually with IP-address, browser, operating system, requested page and originate page. Click the update button to see new added records. View mode "Month" shows the total of all visitors per day from the first to the last day of the selected month. View mode "Year" shows the total of all visitors per month from the first to the last month of the selected year. View mode "Total" shows the total of all visitors per year for all recorded years. Please note that multiple visits from the same IP address within the selected period are counted as a single visitor.
      Settings
      You can access the module settings by clicking the Configuration button at the bottom of the records page. The settings page is also available in the menu: Modules->Configure->ProcessPageViewStat.
      IP2Location
      This module uses the IP2Location database from: http://www.ip2location.com. This database is required to obtain the country from the IP address. IP2Location updates this database at the begin of every month. The settings of ProcessPageViewStat offers the ability to automatically download the database monthly. Please note, that automatically download will not work if your webspace doesn't allow allow_url_fopen.
      Dragscroll
      This module uses DragScroll. A JavaScript available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability in view mode "Day" to drag the records horizontally with the mouse pointer.
      parseUserAgentStringClass
      This module uses the PHP class parseUserAgentStringClass available from: http://www.toms-world.org/blog/parseuseragentstring/. This class is required to filter out the browser type and operating system from the server request.
      Special Feature
      PageViewStatistic for ProcessWire can record the time a visitor viewed the page. This feature is deactivated by default. To activate open the module configuration page and activate "Record view time". If activated you will find a new column "S." in the records which means the time of view in seconds. With every page request, a Javascript code is inserted directly after the <body> tag. Every time the visitor switches to another tab or closes the tab, this script reports the number of seconds the tab was visible. The initial page request is recorded only as a hyphen (-).
       
    • By MoritzLost
      This module allows you to integrate hCaptcha bot / spam protection into ProcessWire forms. hCaptcha is a great alternative to Google ReCaptcha, especially if you are in the EU and need to comply with privacy regulations.

      The development of this module is sponsored by schwarzdesign.
      The module is built as an Inputfield, allowing you to integrate it into any ProcessWire form you want. It's primarily intended for frontend forms and can be added to Form Builder forms for automatic spam protection. There's a step-by-step guide for adding the hCaptcha widget to Form Builder forms in the README, as well as instructions for API usage.
      Features
      Inputfield that displays an hCaptcha widget in ProcessWire forms. The inputfield verifies the hCaptcha response upon submission, and adds a field error if it is invalid. All hCaptcha configuration options for the widget (theme, display size etc) can be changed through the inputfield configuration, as well as programmatically. hCaptcha script options can be changed through a hook. Error messages can be translated through ProcessWire's site translations. hCaptcha secret keys and site-keys can be set for each individual inputfield or globally in your config.php. Error codes and failures are logged to help you find configuration errors. Please check the README for setup instructions.
      Links
      Github Repository and documentation InputfieldHCaptcha in the module directory Screenshots (configuration)

      Screenshots (hCaptcha widget)

       
       

       
×
×
  • Create New...