-
Posts
82 -
Joined
-
Last visited
-
Days Won
1
Posts posted by zyON
-
-
11 hours ago, Robin S said:
You still have the "Unpublished" checkbox on the Settings tab and the "Pub" action button in Page List to deal with. Plus to be extra sure you can hook Pages::publishReady to prevent publishing by any means.
Robin, I don't have the "Unpublished" checkbox because I'm using the RestrictTabView module to hide the Settings and Delete tabs for this role.
Thank you for the hooks code, this will come in handy very soon.-
1
-
-
This is how I solved this question:
I've assigned page-publish permission to the agent role so they can publish pages based on the property template.
I've created a module that with a hook on ProcessPageEdit::buildForm like this
$this->addHookAfter('ProcessPageEdit::buildForm', $this, 'removePublishButton');
The function that handles this just looks at the page being edited and if it has a status of Unpublished, it removes the Publish button:
foreach($form->children() as $f){ if($f->name == "submit_publish" && $page->isUnpublished()) $form->children()->remove($f); // Removes the Publish Button from Properties not yet published. }
This allows the users with agent role to edit already published pages (if they belong to them, something that the module also checks) but keeps them from publish new pages directly.
-
2
-
-
Hi. I'm going to bump this one alive again.
What Adrian was mentioning is exactly what I need. I need to give some users (agents) the possibility to create pages with a specific template (property) but I don't want them to have access to publish it before someone checks if everything is correct. I've used the special permission page-publish and that takes care of that part. But I also need to give them permission to edit the page as soon as they are published so they can make alterations.
I'm kind lost on how to handle this. I guess I'll have creat a module to handle this, but how can I override the page-publish behavior so it can give access to edit published pages? Or should I ignore this permission?
Thanks in advance.
-
On 08/03/2017 at 1:52 PM, Wanze said:
Maybe you can set the headerMargin setting to zero in the WirePDF module configuration? Do you print the header?
Wanze, yes thanks. I was missing the configuration options on the WirePDF module (was checking only the Pages2PDF module configuration).
-
Is there an easy way to remove the space occupied by the header? It's probably me or my setup but I can't seem to remove the space.
-
Sérgio, you're right. I thought you had to use S3 but you can use any server for CloudFront delivery.
Actually there is, you can setup a different origin, like your server: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowCloudFrontWorks.html
-
1
-
-
Wanze: Thanks. You were right, I had to change it to DejaVuSans (but I also had to to copy the DejaVuSansCondensed family to the module ttfonts folder because it was looking for them somehow and throwing an error.
I was using Helvetica and it should contain Portuguese characters... I'm using it on the site text too.
-
Yes, those are on the front-end, but all the other content is ok except for the text coming from the TextAreaLanguage :/.
Are those question marks at the frontend? Then you are probably defining wrong character encoding in you template files or you have saved your template files with wrong encoding.
-
Hi, I'm using multi language support and everything is working well (great module btw) except for the text coming from a TextAreaLanguage field where I get missing characters, like in Portuguese, that are replaced by '?'. Anyone having this problem or know what can be wrong? Thanks.
-
I've not tried yet to block other sites from hotlinking my CloudFront content.
You can also check to apply a cache control http header on the module itself. It will apply it to every file uploaded via the module.
Hotlinking Cloudfront solution:
s3 has bucket policy that you can instruct to only allow images get commands from certain domains and or IP's. But cloudfront does not have this, so this only prtects from direct linking to your s3 files. You can apply some level of defensive tactics to limit hotlinking to your cloudfront distributions.
Here's what I figured out:
1 - On cloudfront create a second distribution that you connect to the same bucket that you are already using, wait for it to fully deploy, then:
2 - Check if ithe files can be served from the new cloudfront distribution, then in PW amazons3/loudfront module, change domain name of cloudfront distribution to new distribution, check if all works and disable the old distribution, it can be deleted it you like (I would if I know it is being used for hotlinking).
This does not stop hotlinking right away, but allows you to stop images from being served from your cloudfront distribution as soon as you switch.
The hotlinking sites will now no longer have images showing up and will have to go to your site and get the new locations.
At least it is an easy defense technique to protect against paying for traffic for images not served via your site. Not fool proof, but it slows things down and makes it harder for leaches...
BTW, it is wise to apply a cache-control http header to the s3 bucket and get the distribution to use this, so your images are served with cache control headers, saves you from unnecessary traffic costs on your s3 account.
Would be nice to see this module working together with the minimize solution module. That would really make things easy!
-
To use amazon cloud front, does the file have to be in s3? Or is it possible to have cloud front work with local processwire files?
Great plugin! I am bookmarking it. Was just curious how amazon works!
Thanks!
CloudFront uses S3. There's no other way.
-
Great module. It's possible to use the module working just with API ? I mean, creating pages with images and files not from the admin but via code.
Thanks. In the current version of the module it will only work with assets uploaded via the admin.
That's something in the roadmap for me but I don't have a date I can share right now because I'm really lacking the time at this moment.
-
1
-
-
Manol, the plugin doesn't handle the deletion of the files in the assets folder. I
f the plugin is active, the files will be delivered through S3 without relying on the local ones , so theoretically you could manually delete them from you local assets folder but I think of it as a backup that you can quickly start using just by deactivating the plugin.EDIT: Sorry, I forgot to mention (too much work) that in the admin, the local files are used. So it's definitely not a good Idea.!
-
1
-
-
I'm not having that problem, but of course that depends on several things.
If you can put the files on the webroot of your hosting root, I think you'll have no problems and can safely ignore the $config->urls->root "hack".
-
1
-
-
This site is also multilingual.
I did it like arjen suggested. Created a _init.php file in the templates folder with $config->urls->root = "/" and then I've uncommented the line (50) on config.php :
$config->prependTemplateFile = '_init.php';
That way, this code is prepended to every template and so it's executed before any code on the templates.
-
3
-
-
I'm using ProCache and as far as I can tell, it's working ok.
-
Arjen:
Neat and clean. Thanks, it solved the problem!
-
2
-
-
I'm having a similar problem with a site hosted on Bluehost and using Processwire 2.4.
The site files are under the public_html/myfolder folder and when I hit the home page in the browser I get the url as it should like: http://www.mysite.com
But when I follow a link I get the url like http://www.mysite.com/myfolder/section. So the folder name appears in the address. Not pretty.
This is what the .htaccess looks like in the public_html folder:
Options +SymLinksIfOwnerMatchRewriteEngine onRewriteCond %{HTTP_HOST} ^(www.)?mysite\.com$AddHandler application/x-httpd-php54 .phpOptions ExecCGI Includes IncludesNOEXEC SymLinksIfOwnerMatch -IndexesRewriteCond %{REQUEST_URI} !^/myfolder/RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ /myfolder/$1RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$RewriteRule ^(/)?$ myfolder/index.php [L]Anyone having the same issue? -
New version available.
The module now has the ability to update the filename when a new thumbnail is created via the thumbnails plugin.
This is important if you use Amazon CloudFront option to serve the files and want to show the changes you've made to the thumbnails immediately (without waiting for the cache to expire).
Because when you create a new image crop it's filename doesn't change, I had to force this change in both the thumbnails files and the source file.
-
5
-
-
There's a new version available. Now supporting file versioning to handle the caching issues of CloudFront.
There's an option on the module configuration that will automatically rename the uploaded files by inserting a timestamp in the file name. This way all the files have unique names and that will make it easier to replace old files already cached by CloudFront (something that can be a huge PITA as many CloudFront, or other CDN systems know well).
-
7
-
-
I've updated the module so now it's possible to set a custom time in seconds to control the cache in the browser and in CloudFront. Previously it used the Expires Header but it's advisable to user the Cache-Control directive instead.
-
1
-
-
julienmarie: I think Pagefile:install is not triggered with files added from the admin and that was my major concern.
Yes, go ahead, fork it and let's create a better module!
-
2
-
-
I've created a module that works with S3 and Cloudfront. See this topic.
-
1
-
-
I've put up a module that works with S3 and Cloudfront. See this topic.
Publish/Unpublish a page setting required to edit published pages
in General Support
Posted
It seems like this hook doesn't work with other Lists, only on the Page Tree list (I'm using ListerPro). Any ideas how can I remove publish and hide buttons from lists?
EDIT: Ok, forget it. The hook still works on a Lister. I had a debug message being fired on the hook handle function that was not appearing, but the unset of the buttons still work.
ProcessPageListActions::getExtraActions